I want to remove the decimal in price on product details page. Although it removes in listing page, but still showing decimal in discount and final price on product details page.
Magento – Magneto 2: Need to remove decimal from price on product detail page
magento2priceproduct-detail-page
Best Answer
Create file and use this code :
=> From :
=> To :
this file is defined from
\Magento\Framework\Pricing\Render\Amount
The price itself is coming from this call:
If we take a look at the file that this method is created based on the class it's inheriting (
/vendor/magento/framework/Pricing/Render/Amount.php
)Update line no 24
To
You need to override
To
and change the value of precision on line 38:
To