Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Discount Coupon Tax issue

    We came across the following issues when applying Discount Coupons:


    • Fixed amount discount coupons apply more discount than configured eg. £0.20 coupon applied £0.23 discount instead
    • Percentage discount coupons calculate against tax-inclusive prices regardless of tax settings eg. 10% discount on £1.00 + VAT (displayed as £1.20) showed as £0.12 instead of £0.10


    Cause


    When DISPLAY_PRICE_WITH_TAX is set to true, the coupon module incorrectly handles tax in two ways:

    • Base calculation issue: Percentage discounts are calculated against tax-inclusive amounts even when MODULE_ORDER_TOTAL_COUPON_INC_TAX is set to false
    • Final amount issue: Tax is incorrectly added to fixed amount coupons even when MODULE_ORDER_TOTAL_COUPON_INC_TAX is set to false


    Solution


    Two changes are required in includes/modules/order_total/ot_coupon.php

    Fix 1: Base Calculation (Line 683)

    From:

    Code:
    if (DISPLAY_PRICE_WITH_TAX !== 'true') {

    To:

    Code:
    if (DISPLAY_PRICE_WITH_TAX !== 'true' || $this->include_tax !== 'true') {

    Why needed

    This ensures that tax is removed from the base order total when calculating discounts if the coupon module is configured to exclude tax, regardless of how prices are displayed in the store.

    Fix 2: Final Amount (Line 597)

    From:

    Code:
    if (DISPLAY_PRICE_WITH_TAX == 'true' && $coupon_details['coupon_type'] == 'F') {

    To:

    Code:
    if (DISPLAY_PRICE_WITH_TAX == 'true' && $coupon_details['coupon_type'] == 'F' && $this->include_tax == 'true') {

    Why needed

    This prevents tax from being added to the final discount amount for fixed amount coupons when the coupon module is configured to exclude tax. Both fixes ensure the coupon module properly respects the MODULE_ORDER_TOTAL_COUPON_INC_TAX setting throughout all calculations.

    Note:
    This issue was initially noticed in Zen Cart 2.1.0 but may exist in other versions

    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: Discount Coupon Tax issue

    Thanks for the report and details! I've created a GitHub PR containing those changes: https://github.com/zencart/zencart/pull/7121

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: Discount Coupon Tax issue

    @Ryk, please see comments made in the GitHub pull request; there are apparently some issues with the suggested changes.

  4. #4
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    331
    Plugin Contributions
    7

    Default Re: Discount Coupon Tax issue

    ... you are moving into a land of both shadow and substance of things and ideas, you have just crossed over into the TWILIGHT ZONE!!!

    A little bit of humor that I think describes the situation well enough... unfortunately.
    A pity I can't add the music.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,524
    Plugin Contributions
    127

    Default Re: Discount Coupon Tax issue

    @Ryk would you please sign off on https://github.com/zencart/zencart/pull/7121 or state objections so it can be dealt with? Thanks.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: Discount Coupon Tax issue

    Quote Originally Posted by swguy View Post
    @Ryk would you please sign off on https://github.com/zencart/zencart/pull/7121 or state objections so it can be dealt with? Thanks.
    Right, otherwise I'm just going to withdraw the PR that I'd submitted on your behalf.

 

 

Similar Threads

  1. v151 Discount coupon and tax issue
    By jayplanedin in forum Bug Reports
    Replies: 0
    Last Post: 28 Mar 2014, 01:59 AM
  2. Replies: 18
    Last Post: 12 Mar 2010, 06:37 PM
  3. discount coupon tax
    By bluesky2008 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 5 Sep 2008, 03:05 PM
  4. Discount Coupon AND Group Discount Tax Problem
    By mrkrinkle in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 11
    Last Post: 5 Apr 2007, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg