Skip to content

Commit 1e7771a

Browse files
author
Mohan Ahuja
committed
ACP2E-98: Customer with global account sharing has to login again in the secondary website when guest checkout is disabled
- Adding check to load JS file only if the global account sharing is enabled by Admin.
1 parent 8ac290f commit 1e7771a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/code/Magento/Customer/Block/Account/AuthenticationPopup.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,16 @@ 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+
}
122134
}

app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
"*": {
2121
"Magento_Ui/js/block-loader": "<?= $block->escapeJs($block->escapeUrl($block->getViewFileUrl(
2222
'images/loader-1.gif'
23-
))) ?>",
23+
))) ?>"
24+
<?php if ($block->isGlobalScopeEnabled()): ?>
25+
,
2426
"Magento_Customer/js/customer-global-session-loader": {}
27+
<?php endif; ?>
2528
}
2629
}
2730
</script>

0 commit comments

Comments
 (0)