Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Plugin Contributions

    Default $product_tax not correct in tpl_product_info_display in 1.5.7?

    Hi, I had a very easy solution for showing prices with and without tax in my 1.5.5 shop.
    I changed the function display_price in currencies.php from:

    return $this->format(zen_add_tax($product_price, $product_tax) * $quantity);


    return $this->format(zen_add_tax($product_price, $product_tax) *$quantity).'<br><font size=1> (&euro; '. number_format(round(($product_price * $quantity),4),4,',','.').' ex BTW )</font>'

    This shows the price everywhere with and without tax, like this:

    ( 0,6061 ex BTW)

    Now I'm installing a new shop version 1.5.7 and included the same code.
    This works everywhere, except in tpl_product_info_display. There the price including tax is shown, but the value for $product_tax is '0'. Prices are shown like this:
    ( 27,2500 EX BTW)

    and when I add . 'BTW = '.$product_tax; to the function:

    return $this->format(zen_add_tax($product_price, $product_tax) *$quantity).'<br><font size=1> (&euro; '. number_format(round(($product_price * $quantity),4),4,',','.').' ex BTW)</font>' . 'BTW = '.$product_tax;

    it says:
    ( 0,7334 EX BTW)BTW = 0

    here it should be 21.

    On the same page, below the product, the other products in the 'family' are shown and those produts are shown with the correct tax.
    Does anyone know how to get the variable $product_tax filled with the right value on the product_info_display page?

    Example on:

    Thanks, Frank.

  2. #2
    Join Date
    Jul 2012
    Plugin Contributions

    Default Re: $product_tax not correct in tpl_product_info_display in 1.5.7?

    Now there is the variable: $products_tax_class_id that can be used in the function zen_get_tax_rate or similar to determine the actual tax. There may be other actions necessary to get there, but there is no variable: $product_tax. Technically it didn't exist in 1.5.5 either, so don't know how that variable was introduced and when upgrading that it didn't get carried over.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Apr 2007
    Plugin Contributions

    Default Re: $product_tax not correct in tpl_product_info_display in 1.5.7?

    It's a local value in currencies.php. In both 1.5.5 and 1.5.7 and also in older versions (1.3.9 p.e.) it standard reads (completely at the bottom of the file):

    function display_price($products_price, $products_tax, $quantity = 1) {
    return $this->format(zen_add_tax($products_price, $products_tax) * $quantity);

    So it's called with a price without tax and a value for $product_tax in all instances except for the tpl_product_info_display.php. There it's called with the price including tax and the value for $product_tax set to 0. That's what I don't understand.

    Cheers, Frank.



Similar Threads

  1. v151 Not showing correct currency
    By oavs in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 20 Sep 2012, 06:06 AM
  2. try to display the products_last_modified in tpl_product_info_display.php not work
    By yierhan2008 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 18 Jun 2008, 03:07 PM
  3. VAT is not correct
    By sentinel_gt in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 7 Jun 2006, 09:47 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Zen-Cart, Internet Selling Services, Klamath Falls, OR