Philatelicos Posted September 10, 2019 Share Posted September 10, 2019 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 Link to comment Share on other sites More sharing options...
Gerardo Martinez G Posted September 10, 2019 Share Posted September 10, 2019 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 Link to comment Share on other sites More sharing options...
Philatelicos Posted September 11, 2019 Author Share Posted September 11, 2019 thanks for the reply What I don't understand is why the initial price appears with two decimals and the price with the discount with four I've checked what you say and it's like that: Link to comment Share on other sites More sharing options...
Philatelicos Posted September 11, 2019 Author Share Posted September 11, 2019 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 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