1212use Magento \Framework \App \ObjectManager ;
1313use Magento \LoginAsCustomerApi \Api \ConfigInterface ;
1414use Magento \LoginAsCustomerApi \Api \GetLoggedAsCustomerAdminIdInterface ;
15- use Magento \Framework \App \Config \ScopeConfigInterface ;
16- use Magento \Store \Model \StoreManagerInterface ;
1715
1816/**
1917 * View model to get extension configuration in the template
@@ -35,36 +33,20 @@ class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInt
3533 */
3634 private $ getLoggedAsCustomerAdminId ;
3735
38- /**
39- * @var ScopeConfigInterface
40- */
41- private $ scopeConfig ;
42-
43- /**
44- * @var StoreManagerInterface
45- */
46- private $ storeManager ;
47-
4836 /**
4937 * @param ConfigInterface $config
5038 * @param HttpContext $httpContext
51- * @param ScopeConfigInterface $scopeConfig
52- * @param StoreManagerInterface $storeManager
5339 * @param GetLoggedAsCustomerAdminIdInterface $getLoggedAsCustomerAdminId
5440 */
5541 public function __construct (
5642 ConfigInterface $ config ,
5743 HttpContext $ httpContext ,
58- ScopeConfigInterface $ scopeConfig ,
59- StoreManagerInterface $ storeManager ,
6044 ?GetLoggedAsCustomerAdminIdInterface $ getLoggedAsCustomerAdminId = null
6145 ) {
6246 $ this ->config = $ config ;
6347 $ this ->httpContext = $ httpContext ;
6448 $ this ->getLoggedAsCustomerAdminId = $ getLoggedAsCustomerAdminId
6549 ?? ObjectManager::getInstance ()->get (GetLoggedAsCustomerAdminIdInterface::class);
66- $ this ->scopeConfig = $ scopeConfig ;
67- $ this ->storeManager = $ storeManager ;
6850 }
6951
7052 /**
@@ -86,19 +68,4 @@ private function isLoggedIn(): bool
8668 {
8769 return (bool )$ this ->httpContext ->getValue (Context::CONTEXT_AUTH );
8870 }
89-
90- /**
91- * Is B2b enabled
92- *
93- * @return bool
94- * @throws \Magento\Framework\Exception\NoSuchEntityException
95- */
96- public function isB2bEnabled (): bool
97- {
98- return (bool )$ this ->scopeConfig ->getValue (
99- "btob/website_configuration/company_active " ,
100- \Magento \Store \Model \ScopeInterface::SCOPE_WEBSITE ,
101- $ this ->storeManager ->getStore ()->getWebsiteId ()
102- );
103- }
10471}
0 commit comments