NexusFred Posted September 15, 2010 Share Posted September 15, 2010 Hello !!I have a shop only who accept only Euro currency.But for the foreigners customers I would like to show just below the price in EURO the dollars converted price, just for information.With the version 1.2.5 of Prestashop I was using this code >>> {convertPriceWithCurrency price=$product->getPrice(true, $smarty.const.NULL, 2) currency=$currencies.0} But with the version 1.3.10 this code doesn't work any more !!Somebody have a clue why ?ThanksPS(sorry for my bad english I'm french lol)Best RegardsNexus Link to comment Share on other sites More sharing options...
NexusFred Posted September 16, 2010 Author Share Posted September 16, 2010 Ok I find what change on the 1.3.10 !!In the file Tools.php of the 1.2.5 version we find this function Line 172 static public function displayPrice($price, $currency, $no_utf8 = false, $convert = true) /* if you modified this function, don't forget to modify the Javascript function formatCurrency (in tools.js) */ if ($convert) $price = self::convertPrice($price, $currency); .... But in the new 1.3.10 the same function have changeLine 214 : static public function displayPrice($price, $currency = NULL, $no_utf8 = false) { if ($currency === NULL) $currency = Currency::getCurrent(); ... We see the var $convert is not present anymore and the if($convert) so.If we change the displayPrice function like this static public function displayPrice($price, $currency = NULL, $no_utf8 = false, $convert) { if ($convert) $price = self::convertPrice($price, $currency); if ($currency === NULL) $currency = Currency::getCurrent(); ... And next in the product.tpl we use this code {convertPriceWithCurrency price=$product->getPrice(true, $smarty.const.NULL, 2) currency=$currencies.0 convert=true} everything work like in the 1.2.5 versionWhat i hope is this change will not causing some bug elsewhere !! Link to comment Share on other sites More sharing options...
lafondadebaco Posted January 5, 2011 Share Posted January 5, 2011 EXCELLENT find!Thanks a lot for that. Link to comment Share on other sites More sharing options...
NexusFred Posted January 13, 2011 Author Share Posted January 13, 2011 Thanks lafondadebacoYou're Welcome Link to comment Share on other sites More sharing options...
sanjay singhdeo Posted February 6, 2012 Share Posted February 6, 2012 Can this be configured on product-list.tpl & homefeatured.tpl Link to comment Share on other sites More sharing options...
rolikas78 Posted August 3, 2014 Share Posted August 3, 2014 Can this be configured on product-list.tpl & homefeatured.tpl it not works for me Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted August 4, 2014 Share Posted August 4, 2014 (edited) hi can you tell the description for this code : {convertPriceWithCurrency price=$product->getPrice(true, $smarty.const.NULL, 2) currency=$currencies.0 convert=true} i want to choose euro or dollar where i have give the id of the currency whether is 2 . How to make it for PS version 1.5.6 Edited August 4, 2014 by karthiiiiiiiiiik (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now