Jump to content

blockBestSellers price without tax


sdancer75

Recommended Posts

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

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 by CartExpert.net (see edit history)
Link to comment
Share on other sites

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 by sdancer75 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...