Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Currency issue in Magento 1.2.1
 
andc
Jr. Member
 
Total Posts:  11
Joined:  2009-01-03
 

Hi,
I had a big problem using magento (country Italy, Currency Euro) with the string representing the price of a product.

Sometimes (yes the issue will occur on a non deterministic basis) an Exception was thrown beacause the function toCurrency (lib/Zend/Currency.php) receives as value a float number like 1,200000000 (so the field is seen as NON numeric and an exception is thrown)

I’m sure in the admin page I inserted 1.2 and also in the db table is stored the value 1.2

The only trick that works for me is to put the line

$value = str_replace(’,’ , ‘.’ , $value);

before the check with is_numeric (lib/Zend/Currency.php:160)

I know this is a very dirty hack, but is the only way I found to solve the issue.

I ran Magento 1.2.1 on a gentoo linuxbox with MySQL 5.0.51, apache 2.2.10 and php 5.2.8

Has anyone had the same (or similar) problem?

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top