AWORewards unable to add new rule and display new promotion at gift voucher page


  • Default avatar
    mervintankw    
     2 years ago
    0

    Hi I'm facing two issues in using AWORewards module in prestashop.

    1. Unable to add new rule
    - I'm unable to add the new rule after clicking on the save button
    - Found out that if I enter something in the rule expiration field then I will not be able to add the new rule
    - Unable to save the new rule meaning when I click on the save button and nothing seems to happen

    2. Display new promotion at gift voucher page
    - I have added a new social promotion and added a rule to the social promotion
    - the reward is supposed to display at the front end page but it doesn't seem to appear

    Hope someone can help me with the above issues

    Thank you very much in advance

  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    1) Sounds like you have some javascript errors. What version of Prestashop and AwoRewards are you using?

    2) how did you set up the social promotion? as a page or a block?
  • Default avatar
    mervintankw    
     2 years ago
    0

    1) I'm using Prestashop 1.6.0.9 and AwoRewards 2.0.4

    2) I set up the social promotion as a page and at the gift voucher page nothing seems to appear at all
  • Your avatar
    seyi    
     2 years ago
    0

    Hi,

    Not finding a problem with those versions. Would have to debug it. Can you send temp admin access to view aworewards in the backend via private message?
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    Thanks for the access.

    I took a look and for the social promotion, the rule looks fine, but you did not enable and add your facebook credentials here:
    aworewards->configuration->external apis

    And for rules not saving, I was not able to reproduce. Is there a specific scenario were it does not save? If using chrome or firefox, can you inspect element and go to the console tab to see if there are any errors that happen when you try to save?
  • Default avatar
    mervintankw    
     2 years ago
    0

    Thanks!

    I will go and configure my facebook credentials for the social promotion.

    The specific scenario is when I input something to the expire date then the save button wouldn't work.
    I'm using chrome Version 38.0.2125.122. Could that be the cause?

    I get the following in the console of chrome's inspect element.

    Uncaught TypeError: Cannot read property 'add' of undefined
    Uncaught TypeError: Cannot read property 'value' of undefined
  • Your avatar
    seyi    
     2 years ago
    0

    Thanks for the info.

    Was able to reproduce the problem. Here is the fix, which will be in the next update. Please access the file:

    /modules/aworewards/views/templates/admin/rule_edit.tpl

    Around line 286 is this:
    <?php
            c1 
    = (form.startdate_date.value.substr(0,4)+form.startdate_date.value.substr(5,2)+form.startdate_date.value.substr(8,2)+'.'
                    
    +form.startdate_time.value.substr(0,2)+form.startdate_time.value.substr(3,2)+form.startdate_time.value.substr(6,2))*1;
            
    c2 = (form.expiration_date.value.substr(0,4)+form.expiration_date.value.substr(5,2)+form.expiration_date.value.substr(8,2)+'.'
                    
    +(form.expiration_time.value=='' '235959' form.expiration_time.value.substr(0,2)+form.expiration_time.value.substr(3,2)+form.expiration_time.value.substr(6,2)))*1;
    ?>


    Please change it to this:
    <?php
            c1 
    = (form.startdate.value.substr(0,4)+form.startdate.value.substr(5,2)+form.startdate.value.substr(8,2)+'.'
                    
    +(trim(form.startdate.value.substr(11))=='' '000000' form.startdate.value.substr(11,2)+form.startdate.value.substr(14,2)+form.startdate.value.substr(17,2)))*1;
            
    c2 = (form.expiration.value.substr(0,4)+form.expiration.value.substr(5,2)+form.expiration.value.substr(8,2)+'.'
                    
    +(trim(form.expiration.value.substr(11))=='' '235959' form.expiration.value.substr(11,2)+form.expiration.value.substr(14,2)+form.expiration.value.substr(17,2)))*1;
    ?>


    That should fix the issue with saving when there is an expiration date.
  • Default avatar
    mervintankw    
     2 years ago
    0

    Yes! It works!

    Thank you so much for your help seyi!