Wrong coupon value calculation when update quantity cart is done


  • Your avatar
    seyi    
     6 years ago
    0

    Hi,

    I've just installed the AwoCoupon 1.0.2.
    Everything is ok but when I update the cart (quantity update), the coupon value is updating with a wrong value.
    This seems to be a bug from Awo as this issue doesn't happen with the standard VM Coupon.
    Could you please help ?
    I've spend a couple of hours trying to find a solution by myself searching on google ... and even by analyzing some php files but without success.


    Some details about my configuration :
    *Awo :
    - Discount calculation set by default After Tax
    - Discount type : Percent
    - Discount value : 10
    *VM 1.1.3
    *Joomla 1.5.11

    Example of issue :
    1 item set in the cart : 19,90€ incl. Tax
    Coupon appears as 1,99€ --> OK
    If I click on the quantity update link --> Coupon becomes 1,96€ ?????

    Many thanks in advance for your help.
  • Your avatar
    seyi    
     6 years ago
    0

    Ah yes. I got that problem too. Looks like the way the total is being calculated is off. I will need to update the component after testing this fix extensively. Here is what you can do.

    In www/administrator/components/com_awocoupon/assets/virtuemart/ps_coupon_process.php

    after line 29
    <?php
    $d
    ['total'] = $totals['order_subtotal']
            + 
    $totals['order_tax']
            + 
    $totals['order_shipping']
            + 
    $totals['order_shipping_tax']
            - 
    $totals['payment_discount'];
    ?>


    add this line
    <?php
    $d
    ['total'] = $totals['order_total']+@$_SESSION['coupon_discount'];
    ?>


    Please post back if you find any problems
    Thanks
  • Default avatar
    cadara    
     6 years ago
    0

    Dear Seyi,

    Thank you very much for your quick answer.
    It works fine now.

    Great component, great assistance, ... perfect, thanks again !

    Kind regards.