Hi Rocky, I have check your old post. However, I am wondering if the following instruction still valid for version 1.3.1. The line 176 in version 1.3.1 is the "static public function switchLanguage()" Can you please kindly provide the latest instruction to change the "Price=0, return "Call for Price" for the new prestashop 1.3.1? Or in which section it should be located? Many Thanks, Marufish Instruction from Rocky in the forum http://www.prestashop.com/forums/viewthread/30213/#163653 The way I would do it is to add the following at line 177 of classes/Tools.php (after the “$price =” line):
if ($price == 0)
return 'Call for price';
and modify js/tools.js in your theme’s directory and add the following to the start of the formatCurrency function:
if (price == 0)
return 'Call for price';
This will change all $0.00 to ‘Call for price’, but on the product page, it will display as ‘Call for price tax incl.’, so you’ll have to modify product.tpl and the tpls of any other modules if necessary and write something like {if $price != 0}{l s=‘tax incl.’}{/if}. You’ll have to modify modules/blockcart/blockcart.php too, since the totals will display as ‘Call for price’ when nothing is in the cart.
{if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL, 2)}
{if $product->getPrice(true, $smarty.const.NULL, 2) > 0}{l s='tax incl.'}{/if}
{/if}
{if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}
{if $product->getPrice(false, $smarty.const.NULL, 2) > 0}{l s='tax excl.'}{/if}
{/if}
{if $priceDisplay == 2}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}{if $product->getPrice(false, $smarty.const.NULL, 2) > 0} {l s='tax excl.'}{/if}
{/if}
{if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
{if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPriceWithoutReduct()}
{if $product->getPriceWithoutReduct() > 0}{l s='tax incl.'}{/if}
{/if}
{if $priceDisplay == 1}
{convertPrice price=$product->getPriceWithoutReduct(true)}
{if $product->getPriceWithoutReduct(true) > 0}{l s='tax excl.'}{/if}
{/if}