Coupon after tax


  • Default avatar
    jgodek    
     13 years ago
    0

    Hi there
    I have tried the posts
    https://awodev.com/forum/awocoupon/help-section/coupon-does-not-work-correclty
    https://awodev.com/forum/awocoupon/help-section/coupon-discount-after-tax

    Still have the problem where my tax is added after the coupon code.
    How do I apply the coupon code after tax/VAT?


    AWO Version: 1.0.0
    VirtueMart 1.1.3
    Joomla! 1.5.10

    Thanks
    Jeff
  • Your avatar
    seyi    
     13 years ago
    0

    For after tax, you should have 'Subtract payment discount before tax/shipping' unchecked in the virtuemart configuration. By default this should be working. Can you give example of your problems and what you are seeing?
  • Default avatar
    jgodek    
     13 years ago
    0

    Hi there! thanks

    It is unchecked.

    I log in as a user.
    -----------------------


    I have a coupon for 20% off

    Product costs: 12.77

    Subtotal: £12.77
    Coupon Discount: - £2.55

    Total: £10.22

    -----------------------

    CHECK OUT
    -----------------------

    Subtotal: £12.77
    Tax Total: £2.55
    Coupon Discount: - £2.55

    Total: £12.77
    -----------------------
    -----------------------

    How Id like it to work is:

    The VAT should be added to £10.22. NOT the old subtotal: £12.77
    Does that make sense?

  • Your avatar
    seyi    
     13 years ago
    0

    I still dont get it. Are you saying the VAT should be calculated on 10.22? Therefore the VAT should be 2.04 (assuming 20% VAT)? If so then this is discount before tax and you want to check the 'subtract discount before tax/shipping'.
  • Default avatar
    jgodek    
     13 years ago
    0

    sorry!
    ill try again

    The issue.

    Example - what should happen...


    Product price is £10.00.
    minus
    Discount code of 20% - £2.00.


    Total product price is now - £8.00.


    The VAT - added at the checkout - should be £1.60 (20% of £8.00)


    So, total price including discount AND vat should be - £9.60.


    WHat is actually happening.


    Product price is £10.00.
    minus
    Discount code of 20% - £2.00.


    Total product price is now - £8.00.


    The VAT actually being added at checkout is 20% of the product price (before the discount has been taken off) - £2.00.


    Total price (including the discount and vat is coming out at £10.00 (which is wrong as it should be £9.60).


    We think the problem is that the system is Calculating VAT based one the original price - when IT SHOULD BE - calculating VAT based on the price AFTER discount.


    I hope this helps and look forward to hearing from you.
  • Your avatar
    seyi    
     13 years ago
    0

    Yep, makes sense. You should check 'subtract discount before tax/shipping' within Virtuemart configuration. This should subtract the coupon discount before calculating the tax. You are using vm113, which I have not used, but it probably has the same problem as 114. Try to see if this will resolve the problem:
    https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax

    Otherwise post back with more info.
  • Default avatar
    jgodek    
     13 years ago
    0

    Yeah we tried with that checked and unchecked, same result
  • Default avatar
    jgodek    
     13 years ago
    0

    Please help. We will buy this com if this works

    Our site is live, you can see our problem.
    The tax is added to the original cost of the product, not the discounted cost.

    === REMOVED LOGIN INFORMATION ====
  • Your avatar
    seyi    
     13 years ago
    0

    In ps_checkout.php, function calc_order_tax, after this
    <?php
    $order_tax 
    $rate;
    ?>


    Added this to fix the problem
    <?php
    if( PSHOP_COUPONS_ENABLE=='1' && @$_SESSION['coupon_redeemed']=="1" && PAYMENT_DISCOUNT_BEFORE=='1')  
        
    $order_tax = ($order_taxable-$_SESSION['coupon_discount'])*$order_tax$order_taxable;
    ?>
  • Default avatar
    jgodek    
     13 years ago
    0

    Great work! tested and it looks good! Thank you
    Wonderful support here

    we ill be using your product for all our eCommerce sites now
  • Default avatar
    jgodek    
     13 years ago
    0

    Suddenly on one site, this has stopped working. I checked the code you provided and it is in place exactly how it was. Not sure if anything really changed on the site admin, but i do not think so. Any idea why suddenly the coupon would now be applied before the tax again? Even with this fix?
  • Your avatar
    seyi    
     13 years ago
    0

    in virtuemart configuration, is subtract payment discount before tax checked? If not, that code I posted is not called.
  • Default avatar
    jgodek    
     13 years ago
    0

    yeah that is checked.
    What happens is the tax isnt added until the Step 1 of the checkout process but the coupon code is added before Step 1.
    On another site, the code works great for us. Just one site we have a problem with.
    https://www.elavonconsumables.eu/index.php

    Store customer Login - jeffgodek
    password: rs232a
  • Your avatar
    seyi    
     13 years ago
    0

    yeah, i dont see the tax until you get to the payment method screen. So is the problem the tax does not show up until later? What version of Virtuemart is this?
  • Default avatar
    jgodek    
     13 years ago
    0

    Im researching this myself, with the client. Hold off just yet. Thanks
  • Default avatar
    tabletennis    
     13 years ago
    0

    Hi,
    reading these posts above, we do have exactly the same tax problem. Taxes are calculated before the discount applies, which is wrong.

    VirtueMart 1.1.16
    AWO : 1.0.10
    Joomla : 1.5.22

    Please help! We really need this coupon to work !
    Thanks!
  • Your avatar
    seyi    
     13 years ago
    0

    for the free version of AwoCoupon, try posts number 9 and 11 in this topic:
    https://awodev.com/forum/awocoupon/help-section/coupon-incorrect
  • Default avatar
    tabletennis    
     13 years ago
    0

    Hi,
    I've tried both and the taxes are still wrong (calculated before discount).

    What should I do ?
    Thanks!
  • Your avatar
    seyi    
     13 years ago
    0

    I think more details would be helpful. Go through a checkout example of what you are seeing and what you expect to see.
  • Default avatar
    tabletennis    
     13 years ago
    0

    Here's an example.

    We're selling item Bag for $14.00. We do have to add the fed. tax (5%) and the prov. tax (8.5% on top of the fed. tax).
    Before we deduct coupon, we have this :
    Bag SP470B CA$14.00 CA$14.00
    Subtotal: CA$14.00

    Total: CA$14.00
    Tax Total: CA$1.95
    Tax Total contains:
    CA$1.25 (8.925% PST Tax)
    CA$0.70 (5% GST Tax)

    Now, we enter COUPON.
    We have this now :

    Bag SP470B CA$14.00 CA$14.00
    Subtotal: CA$14.00
    Coupon Discount: - CA$0.70

    Total: CA$13.30
    Tax Total: CA$1.95
    Tax Total contains:
    CA$1.25 (8.925% PST Tax)
    CA$0.70 (5% GST Tax)

    However, this is WRONG. Taxes have NOT changed. This is how it should be :

    Bag SP470B CA$14.00 CA$14.00
    Subtotal: CA$14.00
    Coupon Discount: - CA$0.70

    Total: CA$13.30
    Tax Total: CA$1.86
    Tax Total contains:
    CA$1.19 (8.925% PST Tax)
    CA$0.67 (5% GST Tax)

    No matter WHEN I entered the coupon (before login, after login, at the end of checkout, etc.) it doesn't change anything.

    I've tried checking and unchecking the 'subtract discount before tax/shipping' within Virtuemart configuration', it doesn't change anything.

    I've also tried what you suggested in the posts above, still no change.

    Our site is live, so you can see by yourself.

    Send me a PM and I'll give you the links.

    Thanks!


  • Your avatar
    seyi    
     13 years ago
    0

    I cant produce this on a vm 116 installation. If I check the subtract discount before tax, the discount is subtracted. You would have to debug the code yourself.

    Here are the files to look at:
    www/administrator/components/com_virtuemart/html/basket.php (displays cart to the customer)
    www/administrator/components/com_virtuemart/html/ro_basket.php (displays confirmation page to the customer)
    www/administrator/components/com_virtuemart/classes/ps_checkout.php function calc_order_tax (calculation for entry in the db)

    The constant for the subtract discount before tax is PAYMENT_DISCOUNT_BEFORE