Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Discount groups and tax calc problem with tax-included pricing

    not to worry,

    I have already committed the changes to the 1.3.9 branch.

  2. #12
    Join Date
    Aug 2008
    Posts
    13
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    PHP Code:
    function get_order_total() {

        global  
    $order;

        
    $order_total_tax $order->info['tax'];

        
    $order_total $order->info['total'];

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

         if (
    $this->include_shipping != 'true'$order_total -= $order->info['shipping_cost'];     
        if (
    $this->include_tax != 'true'$order_total -= $order->info['tax'];
        if (
    $this->include_tax != "true" && $this->include_shipping != 'true'$order_total += $order->info['shipping_tax']; 

        
    $orderTotalFull $order_total;

        
    $order_total = array('totalFull'=>$orderTotalFull'total'=>$order_total'tax'=>$order_total_tax);

        return 
    $order_total;

      } 

  3. #13
    Join Date
    Jul 2009
    Location
    Roswell, NM, USA
    Posts
    97
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Quote Originally Posted by evan70 View Post
    PHP Code:
    function get_order_total() {

        global  
    $order;
        
    $order_total_tax $order->info['tax'];
        
    $order_total $order->info['total'];
        if (
    $this->include_shipping != 'true'$order_total -= $order->info['shipping_cost'];
        if (
    $this->include_shipping != 'true'$order_total -= $order->info['shipping_cost'];     
        if (
    $this->include_tax != 'true'$order_total -= $order->info['tax'];
        if (
    $this->include_tax != "true" && $this->include_shipping != 'true'$order_total += $order->info['shipping_tax']; 
        
    $orderTotalFull $order_total;
        
    $order_total = array('totalFull'=>$orderTotalFull'total'=>$order_total'tax'=>$order_total_tax);
        return 
    $order_total;
      } 
    Shouldn't the second instance of:

    if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];

    actually be:

    if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_tax'];

    So instead it would be:

    PHP Code:
    function get_order_total() {
        global  
    $order;
        
    $order_total_tax $order->info['tax'];
        
    $order_total $order->info['total'];
        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'];    
        if (
    $this->include_tax != 'true'$order_total -= $order->info['tax'];
        
    $orderTotalFull $order_total;
        
    $order_total = array('totalFull'=>$orderTotalFull'total'=>$order_total'tax'=>$order_total_tax);

        return 
    $order_total;
      } 
    Or is it supposed to have the shipping_cost in both rows?

    BTW this is for the includes/modules/order_total/ot_group_pricing.php for anyone reading who isn't sure.

    Blessings,
    Krisann

  4. #14
    Join Date
    Aug 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Quote Originally Posted by shartlesville View Post
    Shouldn't the second instance of:
    #snip#
    Or is it supposed to have the shipping_cost in both rows?
    I'd like to verify this as well, does shartlesville have the correct code listed?

    Best regards

  5. #15
    Join Date
    Jul 2009
    Posts
    71
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Quote Originally Posted by SMiloen View Post
    I'd like to verify this as well, does shartlesville have the correct code listed?

    Best regards
    in order for group discount to correctly function i had to comment out the one of the new lines of code plus substitute shipping_tax for shipping_cost:

    Here is the code as recommended:

    Code:
    function get_order_total() {
        global  $order;
        $order_total_tax = $order->info['tax'];
        $order_total = $order->info['total'];
        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'];    
        if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
        $orderTotalFull = $order_total;
        $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax);
    
        return $order_total;
      }
    and here is what i have -- sorry about all the comments in the code, it helps me to look back and see what came from where

    Code:
      function get_order_total() {
        global  $order;
        $order_total_tax = $order->info['tax'];
        $order_total = $order->info['total'];
    	if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost']; 
    	//if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_cost']; //removed see new code below
    	if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax']; //changed to shipping_tax per http://www.zen-cart.com/forum/showthread.php?t=120341
    	//if ($this->include_tax != "true" && $this->include_shipping != 'true') $order_total += $order->info['shipping_tax'];  //removed due to incorrect discount computation 
    	if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
    	
        $orderTotalFull = $order_total;
        $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax);
    
        return $order_total;
      }

  6. #16
    Join Date
    Mar 2008
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Hi all

    I'm having a similar problem I wonder if you can help me with.

    I offer free shipping on sales of £100 and over but recently had a few sales around the £88 mark with VAT around £13.20 which makes the overall sale £101 and therefore my cart doesn't charge shipping.

    In effect it is therefore giving free shipping on sales under £100 due to the VAT being added.

    Can anyone advise how to change this so the free shipping is only on sales of £100 excluding vat?

    Sorry to crash on here but I've posted several times elsewhere and had no response!

    Thanks
    Tori
    Last edited by pupsandpets; 14 Sep 2009 at 08:47 AM.

  7. #17
    Join Date
    Mar 2008
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Quote Originally Posted by pupsandpets View Post
    Hi all

    I'm having a similar problem I wonder if you can help me with.

    I offer free shipping on sales of £100 and over but recently had a few sales around the £88 mark with VAT around £13.20 which makes the overall sale £101 and therefore my cart doesn't charge shipping.

    In effect it is therefore giving free shipping on sales under £100 due to the VAT being added.

    Can anyone advise how to change this so the free shipping is only on sales of £100 excluding vat?

    Sorry to crash on here but I've posted several times elsewhere and had no response!

    Thanks
    Tori
    Still haven't solved this if anyone can help?

    Thanks

  8. #18
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    What are your settings for Order Totals Modules >> Discount Coupon?

  9. #19
    Join Date
    Mar 2008
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    Quote Originally Posted by Brent View Post
    What are your settings for Order Totals Modules >> Discount Coupon?
    Hi
    They are set as;

    Discount Coupon

    This module is installed
    true

    Sort Order
    280

    Include Shipping
    false

    Include Tax
    false

    Re-calculate Tax
    Standard

    Tax Class
    --none--

  10. #20
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: Discount groups and tax calc problem with tax-included pricing

    With those settings I can't replicate your problem. I have however installed the code changes suggested in this thread but had to miss out the code from post #9

    I also have the Display price with VAT/TAX and Ex VAT/TAX and VAT-mod for European companies installed. Because of the European VAT mod I also made the change suggested here.

    I think there is still a bug in ot_coupon.php when running UK stores. If I have Include Shipping set to false in Order Totals>> Discount Coupon the Order Total is wrong. Sub Totals and VAT are correct though. If I set Include Shipping to true the order total is correct.

    I think ot_coupon.php needs similar code changes as applied to includes/modules/order_total/ot_group_pricing.php but I've tried to copy them across as they are but it doesn't work.

    Sorry I couldn't be more helpful.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v151 Discount coupon giving too much off with tax-included pricing enabled
    By nigelt74 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 16 Apr 2014, 11:05 AM
  2. Replies: 16
    Last Post: 8 Jul 2010, 08:51 PM
  3. Subtracting tax from a set price: how do I do tax-included pricing?
    By willem in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 3 May 2009, 08:34 AM
  4. Replies: 0
    Last Post: 13 Jun 2008, 12:57 PM
  5. Tax not being calculated correctly -- with tax-included pricing
    By nkrcs in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 11 Jun 2008, 07:54 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