Magento 2 : Change store view when currency is changed
-
14-04-2021 - |
Pergunta
Is it possible to change the store view when currency is changed?
For example, On my site, I have 3 currency and 3 stores view, Now when I'm switching my currency USD then storeview also needs to change to an English store view.
Can anyone help me to do that?
Any help would be appreciated thanks in advance.
Nenhuma solução correta
Outras dicas
You should use post dispatch event and check fullaction name
event name :: controller_action_postdispatch
action name :: directory_currency_switch
PHP file
public function execute(\Magento\Framework\Event\Observer $observer) {
if ($this->_request->getFullActionName() == 'directory_currency_switch'){
// your condition to change store view here
}
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange