WP eCommerce
Checkout: wrong calculation of tax when using coupon (4 posts)

  1. Ostotvsn
    Posted 1 year ago #

    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

    - 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 the calculation is Ok !!

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


  2. Ostotvsn
    Posted 1 year ago #

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

  3. Ostotvsn
    Posted 1 year ago #

    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!

  4. Ostotvsn
    Posted 1 year ago #

    Further update: possible problem found.

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic