Patrik Lindblom Posted December 16, 2008 Share Posted December 16, 2008 I want to add the pretax price in the product-listing, like it is done in product.php where both price including and excluding taxes are shown. Been playing around in product-list.tpl but as I´m new to Smarty I can´t figure out how to get it done. Could someone point me in the right direction please? Link to comment Share on other sites More sharing options...
Cybelius Posted January 5, 2009 Share Posted January 5, 2009 I would also be interested in this function: If a client is not logged in, that the price displayed is without tax rather than tax included. Any ideas? Link to comment Share on other sites More sharing options...
Jerremi Posted January 23, 2009 Share Posted January 23, 2009 It should please anyone idea how to display the price without VAT in the category?Thanks Link to comment Share on other sites More sharing options...
error411 Posted March 11, 2009 Share Posted March 11, 2009 or at least include the "incl. tax" tag after the price Link to comment Share on other sites More sharing options...
MikeR Posted April 20, 2009 Share Posted April 20, 2009 Ok, i have managed to do it although it maybe a rather crude way of doing so.edit your product-list.tpl and after the line {foreach from=$products item=product name=products} put in the following code. {assign var=productpriceincvat value=$product.price} {assign var=producttaxid value=$product.id_tax} {php} $producttaxid = $this->get_template_vars('producttaxid'); $sql = 'SELECT * FROM `'._DB_PREFIX_.'tax` WHERE `id_tax` = '.$producttaxid.' ORDER BY `id_tax` DESC'; $result = Db::getInstance()->getRow($sql); $percentage = $result['rate']; $percentage = number_format('1.'.$result['rate'], 2); $totalPrice = $this->get_template_vars('productpriceincvat'); $discountPrice = $totalPrice / $percentage; $discountPrice = round(($discountPrice),2);; $this->assign('productpriceexvat', $discountPrice); {/php} {$discountPrice} find the line where the price is displayed {convertPrice price=$product.price} and then undernieth or where ever you want the ex tax price to be displayed paste.{convertPrice price=$productpriceexvat} ex VAT This code comes with no warranty what so ever so use at your own risk! Link to comment Share on other sites More sharing options...
Recommended Posts