Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display text when prices set to DISPLAY_WITH_TAX is true


mone_willo

Recommended Posts

In the catalog area, I want to display text "incl tax" beside prices when the prices are set to DISPLAY_WITH_TAX = true or display 'excl tax' beside prices when the prices are set to DISPLAY_WITH_TAX = false

 

I've been searching the forum topics but i have not been able to find a solution for the above problem...can someone please help/advise...Tx.

Link to comment
Share on other sites

Hey guys ...thanks in advance for any help rendered!! :-"

 

I am hoping for a quick response...as i would like... to display this text to indicate to customers when prices include tax or not

tx.

 

in class currencies.php:

 

 

change:

 

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

 

 

into:

 

function display_price($products_price, $products_tax, $quantity = 1) {

if (DISPLAY_WITH_TAX) {

$tax_text = 'incl. tax';

} else {

$tax_text = 'excl. tax';

}

return $tax_text . ' ' . $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

Treasurer MFC

Link to comment
Share on other sites

in class currencies.php:

change:

 

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

into:

 

function display_price($products_price, $products_tax, $quantity = 1) {

if (DISPLAY_WITH_TAX) {

$tax_text = 'incl. tax';

} else {

$tax_text = 'excl. tax';

}

return $tax_text . ' ' . $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

 

 

 

Thank you for your help ....it worked!

Link to comment
Share on other sites

  • 5 years later...

Thanks a lot for this help, it's so usefull for me, but I have a question about this.

 

This solution shows always the text "incl tax" but, if you want to show nothing sometimes?

I try to explain it: it depends on the Location of the customer, the text "incl. tax" appears or not.

 

Do you know the answer please?

 

Thank you so much.

Link to comment
Share on other sites

Thanks a lot for this help, it's so usefull for me, but I have a question about this.

 

This solution shows always the text "incl tax" but, if you want to show nothing sometimes?

I try to explain it: it depends on the Location of the customer, the text "incl. tax" appears or not.

 

Do you know the answer please?

 

Thank you so much.

 

I found a solution, if someone need it:

 

function display_price($products_price, $products_tax, $quantity = 1) {

if (DISPLAY_WITH_TAX && $products_tax!=0) {

$tax_text = '<span class="smallText"><em>IVA incluido<em></span>';

} else {

$tax_text = '';

}

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity).' '.$tax_text;

}

 

I don't know if it's the best way but it works!

Thanks a lot.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...