12
12
use Magento \Framework \App \ObjectManager ;
13
13
use Magento \LoginAsCustomerApi \Api \ConfigInterface ;
14
14
use Magento \LoginAsCustomerApi \Api \GetLoggedAsCustomerAdminIdInterface ;
15
- use Magento \Framework \App \Config \ScopeConfigInterface ;
16
- use Magento \Store \Model \StoreManagerInterface ;
17
15
18
16
/**
19
17
* View model to get extension configuration in the template
@@ -35,36 +33,20 @@ class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInt
35
33
*/
36
34
private $ getLoggedAsCustomerAdminId ;
37
35
38
- /**
39
- * @var ScopeConfigInterface
40
- */
41
- private $ scopeConfig ;
42
-
43
- /**
44
- * @var StoreManagerInterface
45
- */
46
- private $ storeManager ;
47
-
48
36
/**
49
37
* @param ConfigInterface $config
50
38
* @param HttpContext $httpContext
51
- * @param ScopeConfigInterface $scopeConfig
52
- * @param StoreManagerInterface $storeManager
53
39
* @param GetLoggedAsCustomerAdminIdInterface $getLoggedAsCustomerAdminId
54
40
*/
55
41
public function __construct (
56
42
ConfigInterface $ config ,
57
43
HttpContext $ httpContext ,
58
- ScopeConfigInterface $ scopeConfig ,
59
- StoreManagerInterface $ storeManager ,
60
44
?GetLoggedAsCustomerAdminIdInterface $ getLoggedAsCustomerAdminId = null
61
45
) {
62
46
$ this ->config = $ config ;
63
47
$ this ->httpContext = $ httpContext ;
64
48
$ this ->getLoggedAsCustomerAdminId = $ getLoggedAsCustomerAdminId
65
49
?? ObjectManager::getInstance ()->get (GetLoggedAsCustomerAdminIdInterface::class);
66
- $ this ->scopeConfig = $ scopeConfig ;
67
- $ this ->storeManager = $ storeManager ;
68
50
}
69
51
70
52
/**
@@ -86,19 +68,4 @@ private function isLoggedIn(): bool
86
68
{
87
69
return (bool )$ this ->httpContext ->getValue (Context::CONTEXT_AUTH );
88
70
}
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
- }
104
71
}
0 commit comments