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-customer
Model
Checkout
ConfigProvider.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Model\Checkout
;
7
8
use
Magento\Checkout\Model\ConfigProviderInterface
;
9
use
Magento\Customer\Model\Url
;
10
use
Magento\Framework\App\ObjectManager
;
11
use
Magento\Framework\UrlInterface
;
12
use
Magento\Store\Model\StoreManagerInterface
;
13
use
Magento\Framework\App\Config\ScopeConfigInterface
;
14
use
Magento\Customer\Model\Form
;
15
use
Magento\Store\Model\ScopeInterface
;
16
17
class
ConfigProvider
implements
ConfigProviderInterface
18
{
22
protected
$storeManager
;
23
28
protected
$urlBuilder
;
29
33
protected
$scopeConfig
;
34
38
private
$customerUrl;
39
46
public
function
__construct
(
47
UrlInterface
$urlBuilder
,
48
StoreManagerInterface
$storeManager
,
49
ScopeConfigInterface
$scopeConfig
,
50
Url
$customerUrl =
null
51
) {
52
$this->urlBuilder =
$urlBuilder
;
53
$this->storeManager =
$storeManager
;
54
$this->scopeConfig =
$scopeConfig
;
55
$this->customerUrl = $customerUrl ??
ObjectManager::getInstance
()
56
->get(Url::class);
57
}
58
62
public
function
getConfig
()
63
{
64
return
[
65
'customerLoginUrl'
=> $this->
getLoginUrl
(),
66
'isRedirectRequired'
=> $this->
isRedirectRequired
(),
67
'autocomplete'
=> $this->
isAutocompleteEnabled
(),
68
];
69
}
70
77
protected
function
isAutocompleteEnabled
()
78
{
79
return
$this->scopeConfig->getValue(
80
Form::XML_PATH_ENABLE_AUTOCOMPLETE
,
81
ScopeInterface::SCOPE_STORE
82
) ?
'on'
:
'off'
;
83
}
84
90
protected
function
getLoginUrl
()
91
{
92
return
$this->customerUrl->getLoginUrl();
93
}
94
100
protected
function
isRedirectRequired
()
101
{
102
$baseUrl = $this->storeManager->getStore()->getBaseUrl();
103
104
if
(strpos($this->
getLoginUrl
(), $baseUrl) !==
false
) {
105
return
false
;
106
}
107
108
return
true
;
109
}
110
}
Magento\Customer\Model\Checkout\ConfigProvider
Definition:
ConfigProvider.php:17
Magento\Customer\Model\Url
Definition:
Url.php:17
Magento\Store\Model\ScopeInterface\SCOPE_STORE
const SCOPE_STORE
Definition:
ScopeInterface.php:21
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\Customer\Model\Checkout\ConfigProvider\$storeManager
$storeManager
Definition:
ConfigProvider.php:22
Magento\Customer\Model\Checkout\ConfigProvider\$urlBuilder
$urlBuilder
Definition:
ConfigProvider.php:28
Magento\Customer\Model\Checkout\ConfigProvider\getLoginUrl
getLoginUrl()
Definition:
ConfigProvider.php:90
Magento\Customer\Model\Checkout\ConfigProvider\isRedirectRequired
isRedirectRequired()
Definition:
ConfigProvider.php:100
Magento\Customer\Model\Form\XML_PATH_ENABLE_AUTOCOMPLETE
const XML_PATH_ENABLE_AUTOCOMPLETE
Definition:
Form.php:19
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
Magento\Customer\Model\Checkout
Definition:
ConfigProvider.php:6
Magento\Framework\UrlInterface
Definition:
UrlInterface.php:12
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Checkout\Model\ConfigProviderInterface
Definition:
ConfigProviderInterface.php:13
Magento\Customer\Model\Checkout\ConfigProvider\__construct
__construct(UrlInterface $urlBuilder, StoreManagerInterface $storeManager, ScopeConfigInterface $scopeConfig, Url $customerUrl=null)
Definition:
ConfigProvider.php:46
Magento\Customer\Model\Checkout\ConfigProvider\isAutocompleteEnabled
isAutocompleteEnabled()
Definition:
ConfigProvider.php:77
Magento\Customer\Model\Checkout\ConfigProvider\$scopeConfig
$scopeConfig
Definition:
ConfigProvider.php:33
Magento\Customer\Model\Form
Definition:
Form.php:14
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\Customer\Model\Checkout\ConfigProvider\getConfig
getConfig()
Definition:
ConfigProvider.php:62