Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2006
    Posts
    3
    Plugin Contributions
    0

    Default Incorrect Order Total With Coupon

    I created a 10% coupon for my items. I had the Discount Coupon settings set to the following.

    ===================================

    Discount Coupons

    This module is installed
    true

    Sort Order
    280

    Include Shipping
    false

    Include Tax
    false

    Re-calculate Tax
    Standard

    Tax Class
    Taxable Goods

    ================

    When an item is checked out and this coupon is used, the total came out to be:

    Item Price: $14.99
    Discount Coupon: -$1.50 (correct)
    Sales Tax: $1.11 (correct - at 8.25%)
    -----------------------------------------------------
    Total: $14.61 (incorrect!)

    If you just grab a calculator and total up the three numbers, it should came out $14.60. Zen-cart is off by 1 cent.

    How do I fix this?

    I'm using Zen Cart 1.2.6.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Incorrect Order Total With Coupon

    How do I fix this?

    I'm using Zen Cart 1.2.6.
    Upgrading should cure the rounding error.

  3. #3
    Join Date
    Apr 2006
    Posts
    44
    Plugin Contributions
    0

    Re: Incorrect Order Total With Coupon

    I seem to be having trouble with this as well. I just recently upgraded to 1.3.0.2 and have read and tried a lot of the mods posted in the forums about the tax rounding issue.

    My site is http://staging.mindmint.s402.sureserver.com/

    My state sales tax is 8.6%. I am using a dollars off coupon based on order total. I have read that ZenCart will add the tax amount to each line item or quantity on a line item, then sum everything together, and do the rest of the calculations specified in the Order Total hierarchy. Is there no fix or way around this? My order totals are off more than a penny like some people mention.

    Also -- when I go to delete the Sales Tax config and create a new one, it confirms that I would like to delete 9% sales tax, not 8.6%. What gives there???

    Example:
    2 x Freedom From Maternal Depression (2 Compact Discs) $88.00
    Sub-Total:
    $88.00

    Standard US Shipping (Standard Rate 5-7 Business Days):
    $8.50

    Discount Coupon: SAVE5 :
    -$5.00

    8.6% WA Sales Tax:
    $7.57

    Total:
    $99.07

    This should really total $44 + $44 + $8.50 - $5.00 * 1.086 = $99.37
    NOT $44 * 1.086 + $44 * 1.086 + $8.50 - $5.00 = $99.07

    If this can't be easily fixed then what? I'm in a situation where configuring ZC has take me nearly a year and I would hate to scrap this and return money on this job just because ZC doesn't follow basic mathematical rules. What gives?
    --
    Brad Schwartz <baschwar at baschwar dot com>
    http://www.baschwar.com/

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Incorrect Order Total With Coupon

    Quote Originally Posted by baschwar
    Also -- when I go to delete the Sales Tax config and create a new one, it confirms that I would like to delete 9% sales tax, not 8.6%. What gives there???
    The displayed value for this is determined by your setting for 'Tax Decimal Places' in Admin->Configuration->My Store.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Incorrect Order Total With Coupon

    Quote Originally Posted by baschwar
    Example:
    2 x Freedom From Maternal Depression (2 Compact Discs) $88.00
    Sub-Total:
    $88.00

    Standard US Shipping (Standard Rate 5-7 Business Days):
    $8.50

    Discount Coupon: SAVE5 :
    -$5.00

    8.6% WA Sales Tax:
    $7.57

    Total:
    $99.07

    This should really total $44 + $44 + $8.50 - $5.00 * 1.086 = $99.37
    NOT $44 * 1.086 + $44 * 1.086 + $8.50 - $5.00 = $99.07
    Sounds like you've got Zen Cart set to not calculate tax on shipping or coupons.
    Admin->Configuration->My Store
    "Basis of Shipping Tax" should likely be the same as "Basis of Product Tax", and both should likely be set to "Shipping Address".

    Then for Admin->Modules->Order Total->ot_coupon, you need to make sure you have it set to recalculate properly. ie:
    Include Tax: true
    Re-calculate Tax: Standard
    You may also have your order-totals set in the wrong order (although what you show above for concept would be the right order). The defaults are:
    Code:
    COD Fee  	ot_cod_fee  	 ---
    Discount Coupon	ot_coupon 	280 
    Group Discount 	ot_group_pricing 	---
    Gift Certificates ot_gv 	840 
    Low Order Fee 	ot_loworderfee 	400 
    Shipping 	ot_shipping 	200 
    Sub-Total 	ot_subtotal 	100
    Tax 	 	ot_tax  		300
    Total 	 	ot_total 	999
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2006
    Posts
    44
    Plugin Contributions
    0

    Default Re: Incorrect Order Total With Coupon

    Quote Originally Posted by DrByte
    The displayed value for this is determined by your setting for 'Tax Decimal Places' in Admin->Configuration->My Store.
    OK -- that helps a bit.
    --
    Brad Schwartz <baschwar at baschwar dot com>
    http://www.baschwar.com/

  7. #7
    Join Date
    Apr 2006
    Posts
    44
    Plugin Contributions
    0

    Default Re: Incorrect Order Total With Coupon

    Quote Originally Posted by DrByte
    Sounds like you've got Zen Cart set to not calculate tax on shipping or coupons.
    Admin->Configuration->My Store
    "Basis of Shipping Tax" should likely be the same as "Basis of Product Tax", and both should likely be set to "Shipping Address".
    These were set as you prescribe.

    Quote Originally Posted by DrByte
    Then for Admin->Modules->Order Total->ot_coupon, you need to make sure you have it set to recalculate properly. ie:
    This was set properly.

    Quote Originally Posted by DrByte
    You may also have your order-totals set in the wrong order (although what you show above for concept would be the right order). The defaults are:
    Code:
    COD Fee  	ot_cod_fee  	 ---
    Discount Coupon	ot_coupon 	280 
    Group Discount 	ot_group_pricing 	---
    Gift Certificates ot_gv 	840 
    Low Order Fee 	ot_loworderfee 	400 
    Shipping 	ot_shipping 	200 
    Sub-Total 	ot_subtotal 	100
    Tax 	 	ot_tax  		300
    Total 	 	ot_total 	999
    These were all in the order you specify above.


    I am still getting an incorrect tax amount as the method of calculating tax (as I understand it being used in ZC) is to tax each qty of a line item (as I showed in my example above). So, no matter what configuration changes I make my tax will be off.

    DrByte- If you'd like access to the admin email me offline and I can get you in if you'd like to look around.

    I'm at the end of my rope and ready to terminate this job, so any input you have would be greatly appreciated.

    Thanks,

    Brad
    --
    Brad Schwartz <baschwar at baschwar dot com>
    http://www.baschwar.com/

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Incorrect Order Total With Coupon

    A. Product Tax is calculated via this formula:
    1. Select a product in the cart.
    2. Determine its selling price
    3. Determine the quantity of this item in the cart.
    4. If one-time charges apply, add to the product's price
    5. Determine the product's tax rate.
    6. Calculate tax for the product.
    7. Go to the next product and start again.

    If the site is set to "include tax in displayed prices", then we simply loop through the products and calculate how much tax is included, so that it can be shown as a subtotal during checkout.

    I think this is the same as what you had said you thought it should be in an earlier post.


    B. So, next we look at shipping:

    As to shipping rates, tax is calculated on shipping based on shipping-module settings and tax-basis settings. If you set a tax class on shipping, then shipping will be taxed according to that tax class's details... ie: depending on rate and zone, etc.

    You've got the Tax Class in your shipping module set to "-None-", which means tax will not be calculated on shipping. Thus, the price you're seeing in the order-totals isn't including shipping taxes.


    C. Finally, we look at coupons:
    Coupons, like shipping rates, are also calculated based on the module settings. In the ot_coupon module, the default settings are:
    - Sort Order=280
    - Include Shipping = true
    - Include Tax = false
    - Recalculate Tax = standard
    - Tax Class = none

    Since you're desiring to have tax refunded where a coupon is used, you need to change the "Recalculate Tax" setting to "Credit Note" and change your Tax Class from '-none-' to the same tax class that your products and shipping are using.


    That should do it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Apr 2006
    Posts
    44
    Plugin Contributions
    0

    Default Re: Incorrect Order Total With Coupon

    This definitely has solved my problem. Thanks for outlining the steps of the order total process.

    Thank you, thank you, thank you!

    Brad
    --
    Brad Schwartz <baschwar at baschwar dot com>
    http://www.baschwar.com/

  10. #10
    Join Date
    Apr 2006
    Location
    Kaneohe, Hawaii USA
    Posts
    22
    Plugin Contributions
    0

    Re: Incorrect Order Total With Coupon

    Just want to add that Dr. Bytes configuration clarifications alleviated some, if not the majority of the issues listed in this thread for me: http://www.zen-cart.com/forum/showthread.php?t=40630.

    BTW, Dr Byte--thank you--this post had some awesomely perfect timing.
    808's ZenCart: http://808StockPhoto.com/gallery/
    Royalty Free Stock Photos at 808 Stock Photography: http://808StockPhoto.com/

 

 

Similar Threads

  1. Cart total incorrect after applying coupon
    By ongat in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 24 Jun 2010, 06:29 PM
  2. Order total wrong with coupon
    By magictom in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 26 Nov 2009, 03:58 AM
  3. Order Total and Taxes inaccurate with Discount Coupon
    By Luna in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 6 Mar 2009, 08:20 AM
  4. PayPal IPN Order Total Incorrect v1.3.7.1 with addons
    By colin270 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 5 Aug 2008, 04:43 PM
  5. Order total incorrect with discount pricing group + tax
    By dbrewster in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 14 Sep 2006, 03:13 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR