Messages after enter coupon code


  • Default avatar
    seweryn    
     12 years ago
    0

    Hello,

    I use free version AwoCoupon. When I enter code before checkout (true or false) it make redirect to checkout.

    In default version VM, after enter true code it make redirect to checkout, but when I enter false code it give me message: "Coupon code not found. Please try again."

    Why in AwoCoupon when I enter false code it make redirect too?

    Please help. Thank you.
  • Default avatar
    seweryn    
     12 years ago
    0

    Any one help? Messages are blocked by AwoCoupon...

    Customer don't know what action was made in cart.

    PRO version have the same issue?
  • Your avatar
    seyi    
     12 years ago
    0

    Hello,

    Yes the messages are reset mainly because Virtuemart calls the coupon function mutliple times and can have multiple of the same messages. The pro version does the same thing.

    As for the redirection issue with invalid coupons, will take a look at it and post back when we have results.
  • Default avatar
    seweryn    
     12 years ago
    0


    Thank you very match for your reply.

    Is any solution to fix the messages?

    Maybe I give more information: messages are generated, but it display it after refresh the site.
    For example:
    1. I enter coupon code
    2. I would update quantity of product in cart or delete product from cart
    3. In default version message is display after action in cart, but with AwoCoupon messages like "Product deleted successfully" etc. are displaying when I refresh the site after action (I delete product - it work, but message display until I refresh the site).

    Thanks for your support.
  • Your avatar
    seyi    
     12 years ago
    0

    What version of Virtuemart are you using?

    I tested Virtuemart 2.1.10 and this is the behavior I found:

    AwoCoupon:
    - invalid coupon code: redirected to checkout with message invalid
    - valid coupon code: redirected to checkout

    Virtuemart:
    - invalid coupon code: redirected to checkout with message invalid
    - valid coupon code: redirected to checkout

    In all cases the customer was redirected to checkout.
  • Your avatar
    seyi    
     12 years ago
    0

    Ahh, my mistake, I was testing the pro version, with the free version, I get a slightly different outcome:

    AwoCoupon Free:
    - invalid coupon code: redirected to checkout and NO message
  • Your avatar
    seyi    
     12 years ago
    0

    Ok, here is what you can do to fix the problem.

    in www/administrator/components/com_awocoupon/helpers/vm_coupon.php, around line 69 is this
    <?php
            JFactory
    ::getApplication()->set('_messageQueue','');
    ?>


    comment it out
    <?php
            
    //JFactory::getApplication()->set('_messageQueue','');
    ?>



    Then around line 275 is this
    <?php
            $task 
    JRequest::getVar('task');
            if(
    $task == 'setcoupon') {
                
    $err =JText::_('COM_VIRTUEMART_COUPON_CODE_INVALID');
                
    JFactory::getApplication()->enqueueMessage($err,'error');
            }
    ?>


    change it to this
    <?php
            
    //$task = JRequest::getVar('task');
            //if($task == 'setcoupon') {
                
    $err =JText::_('COM_VIRTUEMART_COUPON_CODE_INVALID');
                
    JFactory::getApplication()->enqueueMessage($err,'error');
            
    //}
    ?>


    This should also fix the problem in the below post which I was able to duplicate:
    https://awodev.com/forum/awocoupon/help-section/messages-after-enter-coupon-code#comment-3621
  • Default avatar
    seweryn    
     12 years ago
    0

    I use VirtueMart 2.0.8e

    I'll try to really test it today. Thank you very much for your help.

    EDIT:

    I tested this changes and I am very happy with this, because this solution fix my two problems!

    Thank you very very match!