sdancer75 Posted May 22, 2014 Share Posted May 22, 2014 Hi, I am using presta 1.5.x and I want to chage the blockBestSeller to view the price without tax. Looking at file blockbestsellers.tpl and line 43 <span class="price">{$product.price}</span> you can find the code I am looking for, but any try to change the original code to something like {convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)} does not work. What is the appropriate code to make it work ? Regards, Link to comment Share on other sites More sharing options...
CartExpert.net Posted May 22, 2014 Share Posted May 22, 2014 (edited) Hi. $product-> is not correct, because $product is not an object, it's an array. Edit blockbestsellers.php, locate $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency); in the getBestSellers function and change it to: $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], false), $currency); Regards.Robin.The CartExpert Team Edited May 22, 2014 by CartExpert.net (see edit history) Link to comment Share on other sites More sharing options...
sdancer75 Posted May 23, 2014 Author Share Posted May 23, 2014 (edited) Hi. $product-> is not correct, because $product is not an object, it's an array. Edit blockbestsellers.php, locate $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency); in the getBestSellers function and change it to: $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], false), $currency); Regards. Robin. The CartExpert Team Thank you for you reply. I knew that $products-> will not work....(for a moment I thought it was a pointer to a structure heheh ;-) ) Anyway, I just wanted to show you the solution I used for products.tpl and ask for a similar solution. I didn't checked the solution but I am sure it works. Since I am not a prestashop or smarty programmer and I didn't have time to look inside the documentation to understand the engine's logic and find what I was looking for, it was a huge help from you. Thank you for your quick respond. Best regards, Edited May 23, 2014 by sdancer75 (see edit history) Link to comment Share on other sites More sharing options...
CartExpert.net Posted May 23, 2014 Share Posted May 23, 2014 (edited) Hi. The solution is in the previous reply. Regards.Robin.The CartExpert Team Edited May 23, 2014 by CartExpert.net (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