Forums / Templates, Stylesheets, Page Layout / Changing the sub-total wording depending on tax

Changing the sub-total wording depending on tax

Locked

Views: 1,710

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
24 Aug 2007, 10:07 AM
#1
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Changing the sub-total wording depending on tax

At present, I have the sub-total text say "Sub-total (including VAT @17.5%)"; the client has now expanded his options so that tax is sometimes NOT applied.

What I want to do is to change that sub-total text depending on whether tax is "on" or "off".

It seems to me that the logical place to do it is to insert a conditional statement in the function ot_subtotal in includes/modules/order_total/ot_subtotal.php to change the value of MODULE_ORDER_TOTAL_SUBTOTAL_TITLE so my question is - what is the variable for tax on/off?

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

24 Aug 2007, 10:22 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Changing the sub-total wording depending on tax

Ryk:

the client has now expanded his options so that tax is sometimes NOT applied.

...

my question is - what is the variable for tax on/off?

What is the criteria for tax being "sometimes NOT applied" ?

.
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.

24 Aug 2007, 10:27 AM
#3
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Changing the sub-total wording depending on tax

Shipping destination by country

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

24 Aug 2007, 10:55 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Changing the sub-total wording depending on tax

I gather your client is using "tax included in prices" via the admin switch.
Thus, prices always show with tax already included.

But, if the buyer's country matches a certain zone the "tax included" amount is zero because tax is not relevant.
And you're only wanting to change the display text if that tax amount is zero ?

.
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.

24 Aug 2007, 10:57 AM
#5
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Changing the sub-total wording depending on tax

Yep, that's it.

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

24 Aug 2007, 11:21 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Changing the sub-total wording depending on tax

/includes/modules/order_total/ot_subtotal.php
line 38 says this:```
$this->output[] = array('title' => $this->title . ':',


change it to this:```
      $this->output[] = array('title' => $this->title . ($order->info['tax'] == 0 ? '' : TEXT_TAX_INCLUDED_MESSAGE) . ':',
```and add a language define to your extra-definitions folder saying this:```
define('TEXT_TAX_INCLUDED_MESSAGE', '(including VAT @17.5%)');
```And use the default name for the subtotal text (ie: "Subtotal").

.
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.

24 Aug 2007, 11:46 AM
#7
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Changing the sub-total wording depending on tax

Excellent - many thanks. :bigups:

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