For a UK or Europe store we have to show inc VAT prices. i.e. a product selling for £15.95 on the store front would be stored in the admin as £13.5744 - so that when the VAT(17.5%) is added it will make £15.95
Unfortunately Mag seems to only store the price to 2dp. Even is you enter 13.5744 in the admin for the price - you get 13.57 on refresh.
Is it possible to store admin product price in 4dp and at frontend we show on 2dp?.
Cheers,
From Magento 2 settings, you can get the special price configuration in the Advanced Settings of the individual product. Then you only need to enter the number for the discounted price and the active time to apply. As you configure, the special price is applied immediately.
From my understanding, you would need to take a close look at lib/Zend/Currency.php
Further investigating you would need to adjust the precision to 4 instead of 2:
http://framework.zend.com/manual/1.12/en/zend.currency.options.html
(edit: updated link to latest available version)
This thread has more details on implementing such as well, it looks as though Magento also does some price formatting else where also:
http://www.magentocommerce.com/boards/viewthread/16337/
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php
return number_format($value, 4, null, '');
I know its not a definitive answer but hopefully leads you in the right direction.
There is also the function roundPrice() that might have been updated as well. This can be found in app/code/core/Mage/Core/Model/Store.php
Incase you are still stuck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With