• Default avatar
     3 years ago

    I'm not 100% sure if this is Virtuemart or AWOCoupon, but would really appreciate guidance on where to look.

    I am working on an old J1.5 / VM 1.1 / AWO1.0.12 site. The prices are exclusive of VAT. The initial application of a % based coupon works perfectly, however if a product is added to the cart AFTER the coupon has been applied, the coupon calculation is done on the inc VAT price, but then applied to the Ex VAT value. SO in effect an extra 20% is added to the discount.

    The strange thing is that if you then remove a product the VAT calculation is corrected.

    I'm pretty certain it's just that the wrong price element is being used in the function that updates the discount in the 'add product' function, but have no idea where to look to try and find the bug.

    Any ideas or guidance would be gratefully received.


  • Your avatar
     3 years ago


    If you are dealing with an overall discount, and the coupon is not just for specific products, then this is the total used:

    in www/administrator/components/com_awocoupon/helpers/vm_coupon.php, around line 43:

    if( empty( $d['total'])) {
    // we need some functions from the checkout module 
    require_once( CLASSPATH "ps_checkout.php" );
    $checkout = new ps_checkout();
    $totals $checkout->calc_order_totals($d);
    $d['total'] = $totals['order_subtotal']