Jump to content

Top sellers block question


Recommended Posts

HELP!

The blockbestsllers-home.tpl displays the best selling products on my site. However it displays the price including Taxes / VAT.

 

How can I change this so it displays the prices without taxes / VAT?

 

I it this line within blockbestsellers.php that needs changing:

 

$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);

 

 

Please help!

 

Thanks

 

Lee

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

HELP!

The blockbestsllers-home.tpl displays the best selling products on my site. However it displays the price including Taxes / VAT.

 

How can I change this so it displays the prices without taxes / VAT?

 

I it this line within blockbestsellers.php that needs changing:

 

$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);

 

 

Please help!

 

Thanks

 

Lee

 

 

 

I'm on prestashop 1.4.9 and I'm using the module blockbestsellers2. Open the file blockbestsellers2.php and find the line 122

 

$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])),$currency);

 

It's, as you said, the line you have to modify. Just add ", false" after ($bestseller['id_product']) it'll set the argument $usetax to false

 

$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product']),false),$currency);

 

 

 

For your general knowledge, here is the definition of the function getPriceStatic

public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, $usereduc = true, $quantity = 1, $forceAssociatedTax = false, $id_customer = NULL, $id_cart = NULL, $id_address_delivery = NULL)

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...