Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-directory
Controller
Currency
SwitchAction.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Directory\Controller\Currency
;
8
9
class
SwitchAction
extends
\Magento\Framework\App\Action\Action
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
}
Magento\Framework\App\Action\Action\_redirect
_redirect($path, $arguments=[])
Definition:
Action.php:167
Magento\Framework\App\Action\AbstractAction\getResponse
getResponse()
Definition:
AbstractAction.php:70
$storeManager
$storeManager
Definition:
paypal_quote.php:14
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento
Magento\Directory\Controller\Currency\SwitchAction
Definition:
SwitchAction.php:9
Magento\Framework\App\Action\Action
Definition:
Action.php:25
Magento\Directory\Controller\Currency
Definition:
SwitchAction.php:7