Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2004
    Posts
    120
    Plugin Contributions
    0

    Default Custom OT Module, Subtotal without tax

    Is there a way to add another subtotal module, that would show price without tax?

    On checkout i now have

    Subtotal = 12
    tax = 1
    total = 12

    I want

    Subtotal = 12
    Subtotal without tax = 11
    tax = 1
    total = 12

    I have duplicated ot_subtotal module and language file, changed subtotal values to subtotal1. They are shown in the admin panel, but not on checkout page.

    Tnx

  2. #2
    Join Date
    Sep 2004
    Posts
    120
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    Ok, i have found a problem with displaying the module in checkout. I had to change sort order.
    Now i have two modules, both showing same price (inc tax). What must i change to get new module, show subtotal without tax? Can this be done in ot modules?

    tnx

  3. #3
    Join Date
    Sep 2004
    Posts
    120
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    Ok, this is funny. I spend two hours searching for solution here and only after posting this "monologue" thread i found a solution.

    in new, duplicated module, i have changed this

    around line 40
    'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),

    to this

    'text' => $currencies->format($order->info['subtotal']-$order->info['tax'], true, $order->info['currency'], $order->info['currency_value']),

    So i have added this " -$order->info['tax'] "

    tnx

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,586
    Plugin Contributions
    30

    Default Re: Custom OT Module, Subtotal without tax

    When I try this, it subtracts the product tax AND the shipping from the product subtotal.
    I assume you have long since fixed this, so how did you do it?

    Thanks
    Steve

  5. #5
    Join Date
    Sep 2009
    Posts
    71
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    Doesnt seem to work for me on step 3 - of 3 - dont know where its getting that subtotal from - didnt think it would be that simple....

  6. #6
    Join Date
    Jun 2010
    Posts
    1
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    I don't know if someone already responded or if you already figured out, however as no response was placed here I am posting what I did.
    I only modified one file which is /includes/modules/order_total/ot_subtotal.php

    Now the original file had the following line:


    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']);

    And I change such code for:

    if (DISPLAY_PRICE_WITH_TAX == 'true') {

    $newsubtotal=$order->info['subtotal']-$order->info['tax'];

    } else {

    //$newsubtotal=$order->info['subtotal'];

    }



    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($newsubtotal, true, $order->info['currency'], $order->info['currency_value']),
    'value' => $newsubtotal);



    Please note this will only substract the tax amount from the subtotal if the taxes are included in the price, and also that this is basically a cosmetic change only for it to be displayed properly ar check out.

    Hope it helps!

    THNX!

  7. #7
    Join Date
    Apr 2010
    Location
    London, UK
    Posts
    38
    Plugin Contributions
    1

    Default Re: Custom OT Module, Subtotal without tax

    Hi, with this method it subtracts the tax from the product but not from the shipping, how can i change it to subtract tax from everything?
    Clever AV Ltd
    http://www.cleveravltd.co.uk
    ZenCart 1.3.9g

  8. #8
    Join Date
    May 2011
    Location
    Valencia, España
    Posts
    1
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    Someone find a solution to the question of deathman2006.

    I look the same but also with two VAT because now I have products with different types of taxes, and in Spain you must show the tax bases of each tax.

    Should I clone the module taxes? So when one finds a vat show only their tax base, and when he finds two show the two tax bases.

    I use the version of Zencart 1.38a
    I have installed Edit Orders module, PDF Order Center, Include and Exclude Tax in Prices (Nett / Gross), but I want to delete the latter. And show in store prices with taxes included.

    Thanks in advance.
    Sorry for my English.
    Last edited by B.N.; 29 May 2011 at 01:37 PM.

  9. #9
    Join Date
    Jun 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    @rafitaa - For the record - it worked for me - thank you.

  10. #10
    Join Date
    Nov 2011
    Location
    UK
    Posts
    1
    Plugin Contributions
    0

    Default Re: Custom OT Module, Subtotal without tax

    Quote Originally Posted by deathman2006 View Post
    Hi, with this method it subtracts the tax from the product but not from the shipping, how can i change it to subtract tax from everything?
    I had the same problem and the thread is old so original poster may have solved themselves, but for anyone else who struggled like me, here is a solution I think works. I do not know php so I have thrown this together by just examining the thread and the files and trial and error.


    in ot_subtotal change:


    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']);




    to a similar change as suggested before:



    $newsubtotal=$order->info['subtotal']-$order->info['tax']+$order->info['shipping_tax'];

    } else {

    //$newsubtotal=$order->info['subtotal'];
    }

    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($newsubtotal, true, $order->info['currency'], $order->info['currency_value']),
    'value' => $newsubtotal);
    }





    now also change ot_shipping from this:


    $this->output[] = array('title' => $order->info['shipping_method'] . ':',
    'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['shipping_cost']);
    }



    to this:


    if (DISPLAY_PRICE_WITH_TAX == 'true') {

    $newsubtotal=$order->info['subtotal']-$order->info['tax']+$order->info['shipping_tax'];

    } else {

    //$newsubtotal=$order->info['subtotal'];
    }

    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($newsubtotal, true, $order->info['currency'], $order->info['currency_value']),
    'value' => $newsubtotal);
    }



    This worked for me and displayed the correct subtotal ex tax and shipping ex tax.

    Hope that helps save someone a few hours.

    Cheers.

    Faldinio.
    http://www.localorie.co.uk
    Last edited by Faldinio; 28 Feb 2012 at 09:59 PM. Reason: typo

 

 

Similar Threads

  1. v153 Subtotal showing with Tax, need it without.
    By Matt Staines in forum Basic Configuration
    Replies: 7
    Last Post: 26 Nov 2015, 12:47 PM
  2. v151 Subtotal ex tax and total inc tax?
    By Winnie the Pooh in forum Basic Configuration
    Replies: 1
    Last Post: 19 Oct 2013, 06:48 AM
  3. Invoice missing tax on custom shipping module
    By greyman56 in forum Addon Shipping Modules
    Replies: 6
    Last Post: 10 Nov 2011, 11:45 AM
  4. Replies: 0
    Last Post: 1 Dec 2010, 09:41 PM
  5. invoice subtotal excl.tax
    By m.digregorio in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 12 Apr 2010, 04: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