2

I'm new to magento, have been using creloaded, figure it's time to move on to a new e-commerce platform and found this charm at last.

My website have 6 languages and 6 currencies, the base currency is USD and I have GBP, EUR and so on. I do post my products onto Google Base regularly. My problem is I need to be able to specify the currency in URL, i notice each time when we switch currency, the url stay the same and, I would like to know how to set the currency with url?

Samantha
  • 21
  • 1

2 Answers2

3

Magento has a controller which sets the currency: \\Mage_Directory_CurrencyController::switchAction

So it is not possible out of the box, but you could easily implement a small observer (google magento observer) which does this for you.

Just copy the code of the controller and throw it in the controller_action_predispatch event

public function switchAction()
{
    if ($curency = (string) $this->getRequest()->getParam('currency')) {
        Mage::app()->getStore()->setCurrentCurrencyCode($curency);
    }
    $this->_redirectReferer(Mage::getBaseUrl());
}
Fabian Blechschmidt
  • 35,388
  • 8
  • 75
  • 182
0

How to use this demo in magento2.4

sq y
  • 137
  • 9