Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,700
    Plugin Contributions
    123

    Default [Done v1.3.9] Coupon + Taxable shipping messes up VAT in tax included cart

    Same issue as is described here:

    http://www.zen-cart.com/forum/showthread.php?t=120341

    but for coupons instead of group pricing.

    Fixes described by Wilt work correctly (of course, update ot_coupon.php instead of ot_group_pricing).
    That Software Guy. My Store: Zen Cart Modifications
    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.

  2. #2
    Join Date
    Jul 2005
    Location
    UK and Ireland
    Posts
    258
    Plugin Contributions
    1

    Default Re: Coupon + Taxable shipping messes up VAT in tax included cart

    Great work Scott (and thanks also to Wilt)

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,700
    Plugin Contributions
    123

    Default Re: Coupon + Taxable shipping messes up VAT in tax included cart

    I'm going to consolidate the list of fixes to a single post to make it easier on people:

    a) Edit includes/classes/order.php

    circa line 347 - you should see

    PHP Code:
    'subtotal' => 0,
    'tax' => 0,
    'total' => 0
    which should be changed to

    PHP Code:
    'subtotal' => 0,
    'shipping_tax'=>0,
    'tax' => 0,
    'total' => 0
    b) edit includes/modules.order_total/ot_shipping.php

    circa line 67 change

    PHP Code:
    $order->info['tax'] += $shipping_tax_amount;
    $order->info['tax_groups']["$shipping_tax_description"] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax); 
    to

    PHP Code:
    $order->info['tax'] += $shipping_tax_amount;
    $order->info['shipping_tax'] += $shipping_tax_amount;
    $order->info['tax_groups']["$shipping_tax_description"] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax); 
    c) For the original group pricing fix, edit includes/modules/order_total/ot_group_pricing.php

    circa line 60
    change

    PHP Code:
    if ($this->include_shipping != 'true'$order_total -= $order->info['shipping_cost']; 
    to

    PHP Code:
    if ($this->include_shipping != 'true'$order_total -= $order->info['shipping_cost'];
    if (
    $this->include_shipping != 'true'$order_total_tax -= $order->info['shipping_tax'];  
    if (
    $this->include_tax != "true" && $this->include_shipping != 'true'$order_total += $order->info['shipping_tax']; 
    d) For the coupon fix, edit includes/modules/order_total/ot_coupon.php

    circa line 396
    change

    PHP Code:
    if ($this->include_shipping != 'true'$order_total -= $order->info['shipping_cost']; 
    to

    PHP Code:
    if ($this->include_shipping != 'true'$order_total -= $order->info['shipping_cost'];
    if (
    $this->include_shipping != 'true'$order_total_tax -= $order->info['shipping_tax'];  
    if (
    $this->include_tax != "true" && $this->include_shipping != 'true'$order_total += $order->info['shipping_tax']; 
    That Software Guy. My Store: Zen Cart Modifications
    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.

  4. #4
    Join Date
    Jul 2008
    Location
    Ontario, Canada
    Posts
    83
    Plugin Contributions
    0

    Default Re: Coupon + Taxable shipping messes up VAT in tax included cart

    Will this fix work for stores with tax not included in pricing?

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,700
    Plugin Contributions
    123

    Default Re: Coupon + Taxable shipping messes up VAT in tax included cart

    I didn't know there was a problem for stores which don't have tax included in pricing - have you verified this?
    That Software Guy. My Store: Zen Cart Modifications
    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
    Jul 2008
    Location
    Ontario, Canada
    Posts
    83
    Plugin Contributions
    0

    Default Re: Coupon + Taxable shipping messes up VAT in tax included cart

    It's doing to same thing with my store; the coupon is discounting the coupon % from the shipping amount even though it is set to the following in the order total module:

    Discount Coupon (Sort Order 280) (Settings are:false, false, standard)
    Shipping (Sort Order 290)
    Sub-Total (100)
    Tax (300)
    Total(999)

    Display prices with tax: false

    This is a sample of how it is currently calculating:

    Subtotal: $42.00 (correct)
    Coupon (20% off): $-8.40 (correct 42.00 * 20%)
    Shipping: $8.95 (correct 20% is not being removed)
    8% PST: $3.26 (incorrect should be $3.40 see below)
    5% GST: $2.04 (incorrect should be $2.13 see below)
    Total: $47.85 (incorrect should be $48.08)


    The taxes are being calculated as if there is 20% off shipping:
    42.00 - 20% = 33.60 (correct)
    8.95 - 20% = $7.16 (incorrect, should not discount shipping)
    33.60 + 7.16 = 40.76 (incorrect)
    40.76 * 8% = 3.26 (incorrect)
    40.76 * 5% = 2.04 (incorrect)

    I would really appreciate any assistance you may be able to offer me as I am really struggling on this one.


 

 

Similar Threads

  1. Replies: 8
    Last Post: 7 May 2011, 06:42 AM
  2. Replies: 16
    Last Post: 8 Jul 2010, 08:51 PM
  3. Replies: 26
    Last Post: 19 Mar 2010, 04:45 PM
  4. Replies: 0
    Last Post: 13 Jun 2008, 12:57 PM
  5. Tax Exempt w/taxable shipping
    By Shara in forum General Questions
    Replies: 2
    Last Post: 6 Apr 2007, 04:45 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