Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SwitchAction.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  public function execute()
15  {
17  $storeManager = $this->_objectManager->get(\Magento\Store\Model\StoreManagerInterface::class);
18  $currency = (string)$this->getRequest()->getParam('currency');
19  if ($currency) {
20  $storeManager->getStore()->setCurrentCurrencyCode($currency);
21  }
22  $storeUrl = $storeManager->getStore()->getBaseUrl();
23  $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($storeUrl));
24  }
25 }
_redirect($path, $arguments=[])
Definition: Action.php:167
$storeManager