Jump to content

Four decimals in the discounted price


Philatelicos

Recommended Posts

Hello everyone,

I have Prestashop 1.7.6 configured with two decimals. This respects it with the normal price. But if I apply a discount in%, the resulting price shows me with four decimals.

I have tried to modify product-prices.tpl:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{$product.price}</span>

changing it to:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{round($product.price, 2)}</span>

But then it only shows the whole number, without decimals. And what I want is to show the two decimals. Attachment screenshot

Sorry for my English is not good. Thank you

 

decimales-en-precio.jpg

Link to comment
Share on other sites

Already solved changing in the tpl:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{$product.price}</span>

changed by:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{Tools::displayPrice(round($product.price_amount, 2))}</span>

Thank you

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