File tree Expand file tree Collapse file tree 4 files changed +44
-13
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 4 files changed +44
-13
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,4 @@ public function getCustomerForgotPasswordUrl()
119119 {
120120 return $ this ->getUrl ('customer/account/forgotpassword ' );
121121 }
122-
123- /**
124- * Get global account sharing is enabled or not
125- *
126- * @return string
127- */
128- public function isGlobalScopeEnabled ()
129- {
130- $ shareConfig = \Magento \Framework \App \ObjectManager::getInstance ()
131- ->get (\Magento \Customer \Model \Config \Share::class);
132- return $ shareConfig ->isGlobalScope ();
133- }
134122}
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+
7+ namespace Magento \Customer \ViewModel \Customer ;
8+
9+ use Magento \Customer \Model \Config \Share as ConfigShare ;
10+ use Magento \Framework \View \Element \Block \ArgumentInterface ;
11+
12+ class StoreConfig implements ArgumentInterface
13+ {
14+
15+ /**
16+ * @var ConfigShare
17+ */
18+ private ConfigShare $ configShare ;
19+
20+ /**
21+ * Constructor
22+ *
23+ * @param ConfigShare $configShare
24+ */
25+ public function __construct (
26+ ConfigShare $ configShare
27+ ) {
28+ $ this ->configShare = $ configShare ;
29+ }
30+
31+ /**
32+ * Get global account sharing is enabled or not
33+ *
34+ * @return bool
35+ */
36+ public function isGlobalScopeEnabled (): bool
37+ {
38+ return $ this ->configShare ->isGlobalScope ();
39+ }
40+ }
Original file line number Diff line number Diff line change 3838 </item >
3939 </item >
4040 </argument >
41+ <argument name =" view_model" xsi : type =" object" >Magento\Customer\ViewModel\Customer\StoreConfig</argument >
4142 </arguments >
4243 </block >
4344 <block name =" customer.section.config" class =" Magento\Customer\Block\SectionConfig"
Original file line number Diff line number Diff line change 66
77/** @var \Magento\Customer\Block\Account\AuthenticationPopup $block */
88/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
9+ /** @var Magento\Customer\ViewModel\Customer\StoreConfig $viewModel */
10+ $ viewModel = $ block ->getViewModel ();
911?>
1012<div id="authenticationPopup" data-bind="scope:'authenticationPopup', style: {display: 'none'}">
1113 <?php $ scriptString = 'window.authenticationPopup = ' . /* @noEscape */ $ block ->getSerializedConfig (); ?>
2123 "Magento_Ui/js/block-loader": "<?= $ block ->escapeJs ($ block ->escapeUrl ($ block ->getViewFileUrl (
2224 'images/loader-1.gif '
2325 ))) ?> "
24- <?php if ($ block ->isGlobalScopeEnabled ()): ?>
26+ <?php if ($ viewModel ->isGlobalScopeEnabled ()): ?>
2527 ,
2628 "Magento_Customer/js/customer-global-session-loader": {}
2729 <?php endif ; ?>
You can’t perform that action at this time.
0 commit comments