AWO Coupon for Virtuemart adding coupon amount instead of subtracting it


  • Default avatar
    tmdonovan    
     3 years ago
    0

    I downloaded and installed AWO Coupon for Virtuemart today and ran a test with a 10% coupon. It added 10% to the total instead of subtracting it.

    e.g.
    Subtotal $92.00
    TestCoupopn $9.20
    Order Total $101.20

    The extension and plugin were both installed successfully. I also had tested with a Virtuemart 2.0 10% coupon before installing AWO Coupon and it worked fine.

    Where in the code would this be happening?
    Thanks for your help.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    You must be using virtuemart 2.0.21. This will be updated when Virtuemart has a stable production release.

    In the free version, you can update the code, in www/administrator/components/com_awocoupon/helpers/vm_coupon.php, in the function finalize_coupon_vm, around line 350 is something like this:

    <?php
            $this
    ->vmcartPrices['salesPriceCoupon'] = $salesPriceCoupon;
    ?>


    Change it to this
    <?php
            $this
    ->vmcartPrices['salesPriceCoupon'] = $salesPriceCoupon*-1;
    ?>
  • Default avatar
    tmdonovan    
     3 years ago
    0

    Yes, I am using VM 2.0.21. I changed the code as you instructed and now the coupon is discounting correctly. Thanks for your help and your quick response.
  • Default avatar
    FranAyala    
     3 years ago
    0

    same problem in pro version 2.2.21 and VM 2.0.22b

    Solution?

    Thanks
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    If you upgrade to the latest that will fix the problem.
  • Default avatar
    tim_jannis    
     3 years ago
    0

    In pro Version you have to change
    /administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php

    ~line 130

    <?php
    $this
    ->vmcartPrices['salesPriceCoupon'] = $coupon_session['product_discount'] + $coupon_session['shipping_discount'];
    ?>


    to:
    <?php
    $this
    ->vmcartPrices['salesPriceCoupon'] -= $coupon_session['product_discount'] + $coupon_session['shipping_discount'];
    ?>