Magento News
Configurable Product – Drop down changes decimals
by TWDesign (Posted Sun, 23 May 2010 12:01:28 GMT)
On my Magento 1.3 site I have a store view which uses zero decimals for Japanese yen currency
and two decimals for USD currency.
On a Configurable Product page, if a user selects a product attribute from the drop
down selector while using Yen,
the currency format for the price changes to two decimal places
(for Yen, obviously not desirable).
I am guessing that there is some JavaScript that controls this since there
is no page refresh, just an Ajax update OR maybe some php Class I have missed.
I’ve already changed the Store.php file and Currency.php file as follows:
- Code:
lib/Zend/Currency.php file on line 78 from'precision'=>2
to
'precision'=>0
and
- Code:
/app/code/core/Mage/Core/Model/Store.php
around line 733 frompublic function formatPrice($price, $includeContainer = true)
{
if ($this->getCurrentCurrency()) {
return $this->getCurrentCurrency()->format($price, array(), $includeContainer);
}
return $price;
}to
public function formatPrice($price, $includeContainer = true)
{
if ($this->getCurrentCurrency()) {
if($this->getCurrentCurrency() == "USD") {
return $this->getCurrentCurrency()->format($price, array('precision'=>2), $includeContainer);
}
else {
return $this->getCurrentCurrency()->format($price, array('precision'=>0), $includeContainer);
}
}
return $price;
}
http://magento-forum.co.uk/viewtopic.php?f=5&t=269#p1002
Possibly Related Posts:
- Magento USPS Shipping Method, add option / force Insurance by pmuskoff http://t.co/JMbzme8o
- #freelance jobs: Magento USPS Shipping Method, add option / force Insurance by pmuskoff: We run a Mage… http://t.co/X5syN4Xc #projects
- Magento USPS Shipping Method, add option / force Insurance by pmuskoff: We run a Magento store … http://t.co/cjTFzhit #freelance #work
- Magento USPS Shipping Method, add option / force Insurance by pmuskoff: We run a Magento store in… http://t.co/K4NdKyWs #magento #jobs
- We run a Magento store in which everything is shipped via USPS. We ship valuable products which need to be insu… http://t.co/JmW0PeR0
RSS Feed