From ef1926fba4e2bb3a7a8ad816a18179e04a14acc3 Mon Sep 17 00:00:00 2001 From: Nikoloz Gabisonia Date: Thu, 21 Jul 2022 21:31:54 +0400 Subject: [PATCH 1/2] created getAccountSharingOption function to return config option --- src/View/Result/Page.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/View/Result/Page.php b/src/View/Result/Page.php index 8c031e8..9c8bdb4 100644 --- a/src/View/Result/Page.php +++ b/src/View/Result/Page.php @@ -170,4 +170,10 @@ public function getWebsiteCode() { return $this->storeManager->getWebsite()->getCode(); } + + public function getAccountSharingOption() + { + $optionValue = $this->scopeConfig->getValue('customer/account_share/scope', ScopeInterface::SCOPE_WEBSITE); + return $optionValue == "0" ? "global" : "per_website"; + } } From 14e9a6ce4ce0a952104d77f9e366e9e993178221 Mon Sep 17 00:00:00 2001 From: Nikoloz Gabisonia Date: Fri, 22 Jul 2022 12:45:29 +0400 Subject: [PATCH 2/2] fixed CR --- src/View/Result/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Result/Page.php b/src/View/Result/Page.php index 9c8bdb4..194aee8 100644 --- a/src/View/Result/Page.php +++ b/src/View/Result/Page.php @@ -174,6 +174,6 @@ public function getWebsiteCode() public function getAccountSharingOption() { $optionValue = $this->scopeConfig->getValue('customer/account_share/scope', ScopeInterface::SCOPE_WEBSITE); - return $optionValue == "0" ? "global" : "per_website"; + return (int)$optionValue == 0 ? 'global' : 'per_website'; } }