File tree Expand file tree Collapse file tree 5 files changed +16
-8
lines changed
app/code/Magento/LoginAsCustomerAssistance Expand file tree Collapse file tree 5 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 9
9
10
10
use Magento \Framework \App \Config \ScopeConfigInterface ;
11
11
use Magento \LoginAsCustomerAssistance \Api \ConfigInterface ;
12
+ use Magento \Store \Model \ScopeInterface ;
12
13
13
14
/**
14
15
* @inheritdoc
@@ -42,14 +43,20 @@ public function __construct(
42
43
*/
43
44
public function getShoppingAssistanceCheckboxTitle (): string
44
45
{
45
- return (string )$ this ->scopeConfig ->getValue (self ::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TITLE );
46
+ return (string )$ this ->scopeConfig ->getValue (
47
+ self ::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TITLE ,
48
+ ScopeInterface::SCOPE_WEBSITE
49
+ );
46
50
}
47
51
48
52
/**
49
53
* @inheritdoc
50
54
*/
51
55
public function getShoppingAssistanceCheckboxTooltip (): string
52
56
{
53
- return (string )$ this ->scopeConfig ->getValue (self ::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TOOLTIP );
57
+ return (string )$ this ->scopeConfig ->getValue (
58
+ self ::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TOOLTIP ,
59
+ ScopeInterface::SCOPE_WEBSITE
60
+ );
54
61
}
55
62
}
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ public function beforeExtractData(
57
57
$ scope = null ,
58
58
$ scopeOnly = true
59
59
): void {
60
- if (! $ this ->authorization -> isAllowed ( ' Magento_LoginAsCustomer::opt_in_preference ' )
61
- && $ this ->isSetAssistanceAllowedParam ( $ request )
60
+ if ($ this ->isSetAssistanceAllowedParam ( $ request )
61
+ && ! $ this ->authorization -> isAllowed ( ' Magento_LoginAsCustomer::allow_shopping_assistance ' )
62
62
) {
63
63
$ customerId = $ request ->getParam ('customer_id ' );
64
64
$ assistanceAllowedParam =
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public function afterGetMeta(
89
89
): array {
90
90
if (!$ this ->config ->isEnabled ()) {
91
91
$ assistanceAllowedConfig = ['visible ' => false ];
92
- } elseif (!$ this ->authorization ->isAllowed ('Magento_LoginAsCustomer::opt_in_preference ' )) {
92
+ } elseif (!$ this ->authorization ->isAllowed ('Magento_LoginAsCustomer::allow_shopping_assistance ' )) {
93
93
$ assistanceAllowedConfig = [
94
94
'disabled ' => true ,
95
95
'notice ' => __ ('You have no permission to change Opt-In preference. ' ),
Original file line number Diff line number Diff line change 6
6
"magento/framework" : " *" ,
7
7
"magento/module-backend" : " *" ,
8
8
"magento/module-customer" : " *" ,
9
+ "magento/module-store" : " *" ,
10
+ "magento/module-login-as-customer" : " *" ,
9
11
"magento/module-login-as-customer-api" : " *"
10
12
},
11
13
"suggest" : {
12
- "magento/module-login-as-customer-admin-ui" : " *" ,
13
- "magento/module-login-as-customer" : " *"
14
+ "magento/module-login-as-customer-admin-ui" : " *"
14
15
},
15
16
"type" : " magento2-module" ,
16
17
"license" : [
Original file line number Diff line number Diff line change 11
11
<resource id =" Magento_Backend::admin" >
12
12
<resource id =" Magento_Customer::customer" >
13
13
<resource id =" Magento_LoginAsCustomer::login" >
14
- <resource id =" Magento_LoginAsCustomer::opt_in_preference " title =" Change Customer Opt-In Preference " sortOrder =" 20" />
14
+ <resource id =" Magento_LoginAsCustomer::allow_shopping_assistance " title =" Allow remote shopping assistance " sortOrder =" 20" />
15
15
</resource >
16
16
</resource >
17
17
</resource >
You can’t perform that action at this time.
0 commit comments