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

you have to enter the database regularly (phpMyAdmin) and verify this table

ps_currency

precision    is the number of decimals

numeric_iso_code    you will have to enter your currency code

https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm

clear cache and verify

in my case is this

image.png.0b9fd9ef6100acbd6dc242a5136fde07.png

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