Coupon amount not updating on shipping method change


  • Default avatar
    joyce3    
     3 years ago
    0

    Hey there,

    I noticed that when I use a coupon code for free shipping, if I change the shipping method afterwards it doesn't update the amount, resulting in an incorrect Total.

    Here is a screenshot displaying an example:
    http://i.imgur.com/DgYH4v8.png

    Thanks
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    What version of AwoCoupon is this?

    Just tested it out on the latest and not experiencing such a problem. How did you set up the coupon code?
  • Default avatar
    joyce3    
     3 years ago
    0

    Here is the setup:
    http://i.imgur.com/kMCFgq9.png

    How I re-created the problem:

    1) Select Expensive Shipping Method (Overnight)
    2) Enter Coupon Code and receive discount
    3) Change Shipment method and discount does not change


    Thanks
  • Default avatar
    joyce3    
     3 years ago
    0

    Latest version, Version: 2.2.0 pro
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    Ok, I was able to reproduce the problem. It happens because the shipping selections are all within one method, and cache does not detect there is a new shipping. Here is what you can do to fix it.

    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 246 is this
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.$coupon_code.'|'.$user->id.'|'.$user_email;
    ?>


    change it to this
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.$this->vmcartPrices['salesPriceShipment'].'|'.$coupon_code.'|'.$user->id.'|'.$user_email;
    ?>


    and around line 254 is this
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.$user->id;
    ?>


    change it to this
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.$this->vmcartPrices['salesPriceShipment'].'|'.$user->id;
    ?>


    That should fix the problem. This will be updated in the next version of AwoCoupon
  • Default avatar
    joyce3    
     3 years ago
    0

    There we go, all fixed.

    Thanks for the support :)