I'm trying to set the currency based on IP lookup.
So far I've found only this php snippet for setting the currency http://ravikumar85.blogspot.ie/2010/02/magento-set-base-currency-through-code.html
but if I put this code in index.php just before Mage::run()
if($geolookup == 'UK') {
Mage::app()->getStore()->setCurrentCurrencyCode('GBP');
}
I get this error
There has been an error processing your request
Mage registry key "controller" already exists
Any idea?
Thanks
I'm not sure the reason you wish to have the custom modification. Anyway, modify the app/code/core/Mage/Core/Model/Store.php by adding the below code will work you the solution.
public function getCurrentCurrencyCode()
{
if($geolookup == 'UK') {
$this->_getSession()->setCurrencyCode('GBP');
}
......
}