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
Model
Currency
DefaultLocator.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Directory\Model\Currency
;
7
8
class
DefaultLocator
9
{
15
protected
$_configuration
;
16
22
protected
$_storeManager
;
23
28
public
function
__construct
(
29
\
Magento
\Framework\
App
\Config\
ScopeConfigInterface
$configuration
,
30
\
Magento
\
Store
\Model\
StoreManagerInterface
$storeManager
31
) {
32
$this->_configuration =
$configuration
;
33
$this->_storeManager =
$storeManager
;
34
}
35
42
public
function
getDefaultCurrency
(\
Magento
\Framework\
App
\RequestInterface
$request
)
43
{
44
if
(
$request
->getParam(
'store'
)) {
45
$store
=
$request
->getParam(
'store'
);
46
$currencyCode = $this->_storeManager->getStore(
$store
)->getBaseCurrencyCode();
47
}
else
{
48
if
(
$request
->getParam(
'website'
)) {
49
$website
=
$request
->getParam(
'website'
);
50
$currencyCode = $this->_storeManager->getWebsite(
$website
)->getBaseCurrencyCode();
51
}
else
{
52
if
(
$request
->getParam(
'group'
)) {
53
$group
=
$request
->getParam(
'group'
);
54
$currencyCode = $this->_storeManager->getGroup(
$group
)->getWebsite()->getBaseCurrencyCode();
55
}
else
{
56
$currencyCode = $this->_configuration->getValue(
57
\
Magento
\Directory\Model\
Currency::XML_PATH_CURRENCY_BASE
,
58
'default'
59
);
60
}
61
}
62
}
63
64
return
$currencyCode;
65
}
66
}
Magento\Directory\Model\Currency\DefaultLocator\__construct
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Store\Model\StoreManagerInterface $storeManager)
Definition:
DefaultLocator.php:28
Magento\Framework\App
Magento\Directory\Model\Currency\DefaultLocator\$_storeManager
$_storeManager
Definition:
DefaultLocator.php:22
$configuration
$configuration
Definition:
index.php:33
$website
$website
Definition:
payment_configuration_rollback.php:38
$group
$group
Definition:
sections.phtml:16
$storeManager
$storeManager
Definition:
paypal_quote.php:14
Magento\Directory\Model\Currency\XML_PATH_CURRENCY_BASE
const XML_PATH_CURRENCY_BASE
Definition:
Currency.php:30
Magento\Directory\Model\Currency\DefaultLocator\$_configuration
$_configuration
Definition:
DefaultLocator.php:15
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Directory\Model\Currency\DefaultLocator
Definition:
DefaultLocator.php:8
Magento
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
$store
$store
Definition:
payment_configuration_rollback.php:33
Magento\Store\Model\Store
Definition:
Store.php:38
Magento\Directory\Model\Currency\DefaultLocator\getDefaultCurrency
getDefaultCurrency(\Magento\Framework\App\RequestInterface $request)
Definition:
DefaultLocator.php:42
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\Directory\Model\Currency
Definition:
DefaultLocator.php:6