• When using a coupon the the tax keeps being calculated based the original price instead of the new price after the coupon is applied.

    To reproduce
    1) In the settings at the Tax tab:
    1a) check the “Turn tax on”
    b) Select “Product prices are tax exclusive – add tax to the price during checkout”
    1c) Select “Replace tax percentage with product specific tax rate”
    1d) Select “Apply tax when Billing Region is the same as Tax Rate”
    1e) Add a country, for example “Netherlands” and add 21%

    2) Create a coupon with 25% discount
    3) Create a new product with price 100
    4) Buy the product

    At checkout
    5a) make sure you select you select the same country as with 1e
    5b) Enter the Coupon code
    5c) Press the “Update button” behind the coupon code

    Result
    – Cost before shipping: 100, this is Ok.
    – Tax 21,==, this is WRONG,
    this should be (100 – 25%) = 75 * 21% = 15,75
    – Discount: 25,== this is Ok
    – Total price: 96, this is WRONG
    This should be: 75 + 17,75 = 90,15
    BTW, in version 3.8.12.1 the calculation is Ok !!

    I created a complete new test site, with fresh WP 3.9.1 installed
    I added the WP E-Commerce 3.8.14.1 plug-in
    No further plug-ins!

    https://www.lightroomstatistics.com/ontwikkel7

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Ostotvsn

    (@ostotvsn)

    In the sample at the website I used the coupon code TwentyFive, see link.

    Thread Starter Ostotvsn

    (@ostotvsn)

    Further investigation brings that when I use the taxes_controller.class.php module of version 3.8.12, the problem is solved.

    Please look into this!

    Thread Starter Ostotvsn

    (@ostotvsn)

    Further update: possible problem found.
    taxes_controller.class.php

    The line 100:
    /* Only subtract if coupons apply to tax. Likely in 4.0 */
    /* $total_tax -= $coupon_tax; */

    The problem here is that although the option to apply coupon to tax is to be introduced likely in version 4.0, already the calculation has changed.

    Please revert this calculation until the option is added!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Checkout: wrong calculation of tax when using coupon’ is closed to new replies.