Wrong couponcode (not existing) also says "coupon added"


  • Default avatar
    wr    
     a year ago
    0

    Using AwoCoupon 2.3.8 with VM 3.0.9 and J!3.4.3

    When adding a WRONG couponcode to my order im getting a green bar with "coupon added"/"rabatkupon tilføjet"(danish)
    even though it either does not apply to the products on the order or is completely wrong..

    Is this normal behavior?
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    There are some changes in 3.0.9.4 that alter the way coupons act. Even with Awocoupon uninstalled I got some strange behaviors.

    Try this:
    http://forum.virtuemart.net/index.php?topic=130616.msg450050#msg450050
  • Default avatar
    wr    
     a year ago
    0

    according to my extensionlist im just on 3.0.9

    VirtueMart
    Administrator Komponent 3.0.9 May 06 2015 The VirtueMart Development Team


  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    I see. Not sure then. Are you using a checkout extension? As that would control how the coupon is treated.
  • Default avatar
    wr    
     a year ago
    0

    Im using Virtueplanet's One Page Checkout?
  • Default avatar
    wr    
     a year ago
    0

    VP OPC supporter answer:

    I do not think it is problem of VP One Page Checkout plugin. The plugin only displays what is returned by VirtueMart system on submission of coupon. For verification, please disable VP One Page Checkout plugin and post the link of your site so that we can check how it works with standard VirtueMart Checkout system.
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Have you disabled one page and tested it out? Waht is the result? Did look in the file I posted from my first post?
  • Default avatar
    wr    
     a year ago
    0

    yes. When OPC is off it is acting correct. i am also in contact with VP OPC dev. Will update(mark as solved) when issue is solved.
  • Default avatar
    wr    
     a year ago
    0

    okay so Jumbo from VP OPC helped me. He told me that apparently a configuration in AWOCOUPON was not set correct. I had disabled "enable store coupons". This did however only occur when VP OPC was enabled together with your plugin.
    anyway..thanks for help
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    In my testing of 3.0.9.4, your solution works, but only if the coupon does not exist. If the coupon exists but is invalid for the items in the cart, you still get the error.

    I have come up with a solution in AwoCoupon that does not involve changing Virtuemart. It works fine with 3.0.9.4, but not sure how it would cope with your extension. But you can try it out:

    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 255 is this:

    <?php
            $prices 
    $instance->vmcart->getCartPrices();
    ?>


    Change it to this
    <?php
            
    if (version_compare($instance->vmversion'3.0.9''>=')) {
                
    $instance->vmcart->_calculated false;
                
    $instance->vmcart->cartPrices = array();
                
    $instance->vmcart->setCartIntoSession(truetrue);
            }
            else 
    $prices $instance->vmcart->getCartPrices();
    ?>


    Hopefully that works, and you can toggle the enable store coupons to whatever you want and it still works.