Forums / Features Wish List / Display price with VAT/TAX and Ex VAT/TAX

Display price with VAT/TAX and Ex VAT/TAX

Views: 57,806

Results 1 to 20 of 367
3 Oct 2007, 3:17 PM
#1
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Display price with VAT/TAX and Ex VAT/TAX

I have seen that this is on a wishlist and I'd be interested in knowing how far up it is as I'm just about to make changes to my code to do this.

Looking through the code it appears that what needs to be done is:

  1. Make DISPLAY_PRICE_WITH_TAX an integer rather than a boolean. The proposal would be that:


    0- Display prices without Tax
    1- Display prices with Tax
    2- Display both prices

  2. Code changes to functions prices.php and taxes.php and class currencies.php. Am I right in thinking that these are non-custom storable files so the changes I make are to the main code???

  3. Add "Ex. Tax", "Inc. Tax" defines to the language file so the text can be localised ("Ex. VAT" and "Inc. VAT" in my case).

  4. Changes to admin to handle the new DISPLAY_PRICE_WITH_TAX plus a new variable to indicate whether to display the non tax price first or second.

  5. Some new classes in the CSS.

  6. Some quite major changes to the function zen_get_products_display_price($products_id).

Now, am I missing anything?

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

5 Oct 2007, 2:43 PM
#2
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

It was easy enough as it turns out. We've now gone live with the site if anyone wants to take a look:

http://sisirl.com

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

5 Oct 2007, 10:18 PM
#3
doubletiger avatar

doubletiger

Zen Follower

Join Date:
Apr 2005
Posts:
199
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

hem:

It was easy enough as it turns out. We've now gone live with the site if anyone wants to take a look:

http://sisirl.com

Do you mind share your tips?

thanks!

5 Oct 2007, 11:45 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Nice looking - clean layout - but a bit slow to load - some optimizing would be helpful. http://www.websiteoptimization.com/services/analyze/wso.php?url=http://sisirl.com/

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

8 Oct 2007, 8:04 AM
#5
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

Kim- thank you for that. It looks like my bottleneck is in the image sizes. I'll increase my compression rates and see if that's any better.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

8 Oct 2007, 11:16 AM
#6
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

As requested- Here's a how to. I must stress that this should not be attempted unless you are confident with working with programming languages and make sure you back up your cart before doing anything else!!!.

Some of the coding takes place in the core modules rather than the user generated custom files.

First I added 2 new defines to the end of the list in ../includes/languages/custom/english.php. My additions tagged !!! AGM:

// extra product listing sorter
  define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER', '');
  define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER_NAMES', 'Items starting with ...');
  define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER_NAMES_RESET', '-- Reset --');

// Tax/VAT headings !!!
	define('PRICE_EX_TAX_TEXT','Ex VAT'); // !!! AGM
	define('PRICE_INC_TAX_TEXT','Inc VAT'); // !!! AGM
	
///////////////////////////////////////////////////////////
// include email extras

Then I added some Tax styles to my stylesheet at ../includes/templates/custom/css/stylesheet.css

.productSpecialPrice, .productSalePrice, .productSpecialPriceSale, .productPriceDiscount {
	color: #ff0000;
	}

.productTaxPrice // !!! AGM
{
	color: #808080;
}

.productTaxIncTag, .productTaxExTag // !!! AGM
{
	font-size: 80%;
}

.productTaxExTag // !!! AGM
{
	color: #000000;
}

.productTaxIncTag // !!! AGM
{
	color: #808080;
}

.orderHistList {
	margin: 1em;
	padding: 0.2em 0em;
	list-style-type: none;
	} 

Next I changed the zen_add_tax function to include an override so that it would include tax in a price regardless of what the DISPLAY_PRICE_WITH_TAX value was set to. This is in ../includes/functions/functions_taxes.php. I did try saving this to a custom folder but zencart would handle it so I changed the main core code.

// Add tax to a products price based on whether we are displaying tax "in" the price !!! AGM- $include_tax is an override
  function zen_add_tax($price, $tax, $include_tax='false') {
    global $currencies;

    if ( ($include_tax==true || DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
    } else {
      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    }
  }

I then added two more functions to the bottom of the currency class at ../includes/classes/currencies.php:

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

  function display_price_with_tax($products_price, $products_tax, $quantity = 1) { // !!! AGM
    return $this->format(zen_add_tax($products_price, $products_tax, true) * $quantity);
  }

  function display_price_without_tax($products_price, $products_tax, $quantity = 1) { // !!! AGM
    return $this->format($products_price * $quantity);
  }
}
?>

Finally I made some major changes to the zen_get_products_display_price function to provide the output. This is in ../includes/functions/functions_prices.php:

////
// Display Price Retail
// Specials and Tax Included
  function zen_get_products_display_price($products_id) {
    global $db, $currencies;

    $free_tag = "";
    $call_tag = "";

// 0 = normal shopping
// 1 = Login to shop
// 2 = Can browse but no prices
    // verify display of prices
      switch (true) {
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
        // customer must be logged in to browse
        return '';
        break;
        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
        // customer may browse but no prices
        return TEXT_LOGIN_FOR_PRICE_PRICE;
        break;
        case (CUSTOMERS_APPROVAL == '3' and TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM != ''):
        // customer may browse but no prices
        return TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM;
        break;
        case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customer_id'] == ''):
        // customer must be logged in to browse
        return TEXT_AUTHORIZATION_PENDING_PRICE;
        break;
        case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customers_authorization'] > '0'):
        // customer must be logged in to browse
        return TEXT_AUTHORIZATION_PENDING_PRICE;
        break;
        default:
        // proceed normally
        break;
      }

// show case only
    if (STORE_STATUS != '0') {
      if (STORE_STATUS == '1') {
        return '';
      }
    }

    // $new_fields = ', product_is_free, product_is_call, product_is_showroom_only';
    $product_check = $db->Execute("select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");

    $show_display_price = '';
    $display_normal_price = zen_get_products_base_price($products_id);
    $display_special_price = zen_get_products_special_price($products_id, true);
    $display_sale_price = zen_get_products_special_price($products_id, false);

    $show_sale_discount = '';
    if (SHOW_SALE_DISCOUNT_STATUS == '1' and ($display_special_price != 0 or $display_sale_price != 0)) {
      if ($display_sale_price) {
        if (SHOW_SALE_DISCOUNT == 1) {
          if ($display_normal_price != 0) {
            $show_discount_amount = number_format(100 - (($display_sale_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS);
          } else {
            $show_discount_amount = '';
          }
          $show_sale_discount = '<span class="productPriceDiscount">' . '<br />' . PRODUCT_PRICE_DISCOUNT_PREFIX . $show_discount_amount . PRODUCT_PRICE_DISCOUNT_PERCENTAGE . '</span>';

        } else {
          $show_sale_discount = '<span class="productPriceDiscount">' . '<br />' . PRODUCT_PRICE_DISCOUNT_PREFIX . $currencies->display_price(($display_normal_price - $display_sale_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT . '</span>';
        }
      } else {
        if (SHOW_SALE_DISCOUNT == 1) {
          $show_sale_discount = '<span class="productPriceDiscount">' . '<br />' . PRODUCT_PRICE_DISCOUNT_PREFIX . number_format(100 - (($display_special_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS) . PRODUCT_PRICE_DISCOUNT_PERCENTAGE . '</span>';
        } else {
          $show_sale_discount = '<span class="productPriceDiscount">' . '<br />' . PRODUCT_PRICE_DISCOUNT_PREFIX . $currencies->display_price(($display_normal_price - $display_special_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT . '</span>';
        }
      }
    }

	if ($display_special_price) {
      $show_normal_price = '<span class="normalprice">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . ' </span>';
      if ($display_sale_price && $display_sale_price != $display_special_price) {
        $show_special_price = ' ' . '<span class="productSpecialPriceSale">' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';
		$show_price_with_tax='<br />'.'<span class="productTaxPrice">'.$currencies->display_price_with_tax($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span>'; // !!! AGM
        if ($product_check->fields['product_is_free'] == '1') {
          $show_sale_price = '<br />' . '<span class="productSalePrice">' . PRODUCT_PRICE_SALE . '<s>' . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>' . '</span>';
        } else {
          $show_sale_price = '<br />' . '<span class="productSalePrice">' . PRODUCT_PRICE_SALE . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';
        }
      } else {
        if ($product_check->fields['product_is_free'] == '1') {
          $show_special_price = '<br />' . '<span class="productSpecialPrice">' . '<s>' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>' . '</span>';
        } else {
          $show_special_price = '<br />' . '<span class="productSpecialPrice">' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';
        }
        $show_sale_price = '';
	$show_price_with_tax='<br />'.'<span class="productTaxPrice">'.$currencies->display_price_with_tax($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span>'; // !!! AGM
      }
    } else {
      if ($display_sale_price) {
        $show_normal_price = '<span class="normalprice">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . ' </span>';
        $show_special_price = '';
        $show_sale_price = '<br />' . '<span class="productSalePrice">' . PRODUCT_PRICE_SALE . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';
	$show_price_with_tax='<br />'.'<span class="productTaxPrice">'.$currencies->display_price_with_tax($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span>'; // !!! AGM
      } else {
        if ($product_check->fields['product_is_free'] == '1') {
          $show_normal_price = '<s>' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>';
        } else {
          $show_normal_price = $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        }
        $show_special_price = '';
        $show_sale_price = '';
	$show_price_with_tax='<br />'.'<span class="productTaxPrice">'.$currencies->display_price_with_tax($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'</span>'; // !!! AGM
      }
    }

    if($display_normal_price == 0) // don't show the $0.00
	{
		$final_display_price=''; // !!! AGM
		$final_display_price_with_tax=''; // !!! AGM
		$final_display_ex_tag=''; // !!! AGM
		$final_display_inc_tag=''; // !!! AGM
	}
    else
	{
		$final_display_price = $show_normal_price;  // !!! AGM
		$final_display_price_with_tax=$show_price_with_tax; // !!! AGM
		$final_display_ex_tag='<span class="productTaxExTag"> '.PRICE_EX_TAX_TEXT.'</span>'; // !!! AGM
		$final_display_inc_tag='<span class="productTaxIncTag"> '.PRICE_INC_TAX_TEXT.'</span>'; // !!! AGM
	}
	
//	if DISPLAY_PRICE_WITH_TAX=2 !!! AGM
	 $final_display_price = $final_display_price . $show_special_price . $show_sale_price . $final_display_ex_tag . $show_sale_discount . $final_display_price_with_tax . $final_display_inc_tag; // !!! AGM
//	else // !!! AGM
//	 $final_display_price = $final_display_price . $show_special_price . $show_sale_price . $show_sale_discount; // !!! AGM

   // If Free, Show it
    if ($product_check->fields['product_is_free'] == '1') {
      if (OTHER_IMAGE_PRICE_IS_FREE_ON=='0') {
        $free_tag = '<br />' . PRODUCTS_PRICE_IS_FREE_TEXT;
      } else {
        $free_tag = '<br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_PRICE_IS_FREE, PRODUCTS_PRICE_IS_FREE_TEXT);
      }
    }

    // If Call for Price, Show it
    if ($product_check->fields['product_is_call']) {
      if (PRODUCTS_PRICE_IS_CALL_IMAGE_ON=='0') {
        $call_tag = '<br />' . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT;
      } else {
        $call_tag = '<br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_CALL_FOR_PRICE, PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT);
      }
    }

    return $final_display_price . $free_tag . $call_tag;
  }

Hope that's helpful. Feel free to ask me any questions. I do want to add admin items to this as currently the scheme is hardwired rather than set by a variable switch- I think I've said before that I would like to make DISPLAY_PRICE_WITH_TAX at integer rather than a variable.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

8 Oct 2007, 11:31 AM
#7
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

I should point out that this is ZenCart 1.3.7

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

14 Oct 2007, 8:25 PM
#8
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Hi,
I followed your procedure and the Inc and Ex prices displayed are the same.
Any Idea how that can be possible?

For eaxmple:
Price displayed should be 2.51 Ex Vat
and 3.00 Inc Vat.
But the displayed price is
3.00 Ex Vat
3.00 Inc Vat

Regards,
Peter Berkhout

15 Oct 2007, 2:04 PM
#9
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Hem do you think this could be applied ONLY to product page not in the listings?!

15 Oct 2007, 2:42 PM
#10
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

Birch, check that your "Display Prices with Tax" is set to false in Admin-> Configuration-> My Store.

Poosk, can you give me more details of what you are trying to do and I will look into it, thanks.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

15 Oct 2007, 10:24 PM
#11
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Hem,
yes "Display prices with tax" is set to false.
When I set it to true the result stays the same.
The INC price is displayed in either setting.

I have one Tax zone "All" with All Countries and All zones.

I have 2 Tax Classes:
ID Tax Classes
3 BTW Hoog
2 BTW Laag

Priority Tax Class Zone Tax Rate
0 BTW Hoog All 19%
0 BTW Laag All 6%

Regards,
Peter.

15 Oct 2007, 10:50 PM
#12
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Hem,
I suddenly had an attack of mental clarity....
Can it be that in the code you have posted you define
the function display_price_without_tax but never call it in ../includes/functions/functions_prices.php

I changed the function display_price in currencies.php
to return $this->format($products_price * $quantity);

Now the results are as expected.

is display_price also used for totals? If so than this will not be
a good hack.

Regards,
Peter.

16 Oct 2007, 11:08 AM
#13
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

Peter, that will work but as you say it's not a good hack. We need to find out why the tax is being returned. The logic in the function zen_add_tax states that tax is added to the price if the following expression is true:

if(($include_tax==true || DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0))

so return price with tax if $include_tax is true or DISPLAY_PRICE_WITH_TAX is 'true' and the tax rate is greater than zero.

So we know the tax rate is greater than zero because the price is being returned with tax. And $include_tax is false because it is the default when being called by display_price. So that leaves DISPLAY_PRICE_WITH_TAX must be still set to 'true' but you say you've checked your configuration and Display Tax with Prices is set to false.

can you edit the zen_add_tax function (in functions/functions_taxes.php) and add the following line reight before the if statement:

echo $include_tax."-".DISPLAY_PRICE_WITH_TAX."-".$tax."<br>";

Hopefully that should tell us where the problem lies.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

16 Oct 2007, 11:47 AM
#14
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Hem,

in function zen_add_tax($price, $tax, $include_tax='false')

I Changed:
if ( ($include_tax==true || DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) )

to

if ( ($include_tax=='true' || DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) )

Restored the original display_price function and it seems that it is working as expected now.

Can it be a windows/linux difference?

My testenvironment: (WAMP) XP SP2, Apache 2.2, PHP5, MySQL 5.
production will be a LAMP based environment

Regards,
Peter Berkhout

16 Oct 2007, 12:09 PM
#15
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Changing the function declaration to:
function zen_add_tax($price, $tax, $include_tax=false)

boolen false does the trick as well.

In my C programmingperiod anything not null '\0' would be
evaluated to true. Since 'false' is a string it will evaluate to true
in
if ( ($include_tax==true || DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) )

Probably the same in PHP (5).

Regards,
Peter Berkhout

16 Oct 2007, 1:34 PM
#16
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

hmmm, looks like a transcription error as my function says:

function zen_add_tax($price, $tax, $include_tax=false)

Anyway, it looks like you nailed it.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

16 Oct 2007, 1:46 PM
#17
birch avatar

birch

New Zenner

Join Date:
Mar 2007
Location:
Amsterdam, The Netherlands
Posts:
11
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

Andrew,
thanks for the feature you programmed. I will definitely use it in my webshop.

Regards,
Peter.

17 Oct 2007, 8:07 AM
#18
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

Peter- you are welcome- thanks for the bug fix and feedback.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

17 Oct 2007, 11:16 AM
#19
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: Display price with VAT/TAX and Ex VAT/TAX

hem:

Birch, check that your "Display Prices with Tax" is set to false in Admin-> Configuration-> My Store.

Poosk, can you give me more details of what you are trying to do and I will look into it, thanks.

So when looking to your site you have both prices displayed in all product listings and in listing boxes (featured,special,new). But what I'd need to do is to display both prices ONLY in the product page.

So I guess if I want to do it, I have to hide prices everywhere else?

Another notes: Does this display both prices in shopping cart? and could this be turned off after login when the prices are already without or with tax?

I guess there could be simpler method for my need as well. Can the price without tax be called with some zen parameter? Since I'm using multiple tax classes I can't hard code it..

17 Oct 2007, 2:10 PM
#20
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Display price with VAT/TAX and Ex VAT/TAX

I think the way I would approach it would be to edit the zen_get_display_price function, add a parameter to the function say $advanced_display defaulted to false. Then add the necessary code to the function to only product the Inc/En Tax output if this parameter is set to true. I'd then edit the product listings and product pages to call zen_get_display_price($product_id,true).

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com