[solved] Coupon does not work correclty


  • Your avatar
    seyi    
     6 years ago
    0

    Hello,

    My system is
    Joomla 1.5.20
    VM 1.1.5
    AW Coupon Pro 1.1.0

    The Virtuemart coupon system works correctly. I use discount system before taxes and transport.

    I'm not able to understand what kind of logic AWcoupon uses. This is a pratic situation with a coupon with 20% discount:

    Item: 295,00 + VAT 20%
    Subtotal: 295,00
    VAT: 44,84
    Total 269,40

    (the total should be (295-20%)+20%VAT = 283,20).


  • Your avatar
    seyi    
     6 years ago
    0

    Actually, not for me.

    I installed
    - Joomla 1.5.15
    - Virtuemart 1.1.5

    Configured in virtuemart
    - checked Subtract payment before tax/shipping
    - Vat of 20%
    - Created a product of 500 without tax, 600 with
    - Created a coupon of 20%

    Results
    - Subtotal 600
    - Total 456
    - Tax 80

    This is all on a system that has never had AwoCoupon installed. The results do not even show you the discount, which is a bug that resulted from trying to fix the discount before tax problem of Virtuemart 1.1.4:
    http://dev.virtuemart.net/redmine/issues/159

    The fix for that is in
    www/administrator/components/com_virtuemart/html/basket.php around line 256, change
    <?php
    $discount_after
    =false;
    ?>

    to
    <?php
    $discount_before
    =true;
    ?>


    When I do that, I now see a discount of 120, which is exactly 20% of 600. So the discount is correct, the total is off. While you are in the same file, if you change around line 258
    <?php
    $total 
    -= ($_SESSION['coupon_discount'] * $my_taxrate);
    ?>

    to
    <?php
    //$total -= ($_SESSION['coupon_discount'] * $my_taxrate);
    ?>


    The total should come out correctly. I did this, and my total came out to 480. And I remind you, I never installed AwoCoupon on this site, this is just dealing with Virtuemart Coupons.

    Taking your example, if you multiply the discount by the taxrate and subtract it from the total, as the line we comment out above you get
    283.20 - (70.80*0.2) = 269.04
    which is basically the total you are seeing. So hopefully, once you make the above changes, your shopping cart should look alot better.
  • Default avatar
    cristian    
     6 years ago
    0

    Thank you Seyi, I solved it with you help!