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()
119
119
{
120
120
return $ this ->getUrl ('customer/account/forgotpassword ' );
121
121
}
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
- }
134
122
}
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 38
38
</item >
39
39
</item >
40
40
</argument >
41
+ <argument name =" view_model" xsi : type =" object" >Magento\Customer\ViewModel\Customer\StoreConfig</argument >
41
42
</arguments >
42
43
</block >
43
44
<block name =" customer.section.config" class =" Magento\Customer\Block\SectionConfig"
Original file line number Diff line number Diff line change 6
6
7
7
/** @var \Magento\Customer\Block\Account\AuthenticationPopup $block */
8
8
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
9
+ /** @var Magento\Customer\ViewModel\Customer\StoreConfig $viewModel */
10
+ $ viewModel = $ block ->getViewModel ();
9
11
?>
10
12
<div id="authenticationPopup" data-bind="scope:'authenticationPopup', style: {display: 'none'}">
11
13
<?php $ scriptString = 'window.authenticationPopup = ' . /* @noEscape */ $ block ->getSerializedConfig (); ?>
21
23
"Magento_Ui/js/block-loader": "<?= $ block ->escapeJs ($ block ->escapeUrl ($ block ->getViewFileUrl (
22
24
'images/loader-1.gif '
23
25
))) ?> "
24
- <?php if ($ block ->isGlobalScopeEnabled ()): ?>
26
+ <?php if ($ viewModel ->isGlobalScopeEnabled ()): ?>
25
27
,
26
28
"Magento_Customer/js/customer-global-session-loader": {}
27
29
<?php endif ; ?>
You can’t perform that action at this time.
0 commit comments