storeManager = $storeManager; $this->getExtensionName = $getExtensionName; $this->getExtensionInformation = $getExtensionInformation; $this->configUtils = $configUtils; } /** * Check if module is enabled on any store view. * * @param string $moduleName * @return bool */ public function execute(string $moduleName): bool { $moduleName = $this->getExtensionName->execute($moduleName); $configPath = $this->getExtensionInformation->execute($moduleName)->getIsEnabledFieldConfigPath(); foreach ($this->storeManager->getStores() as $store) { if (! $store->getIsActive()) { continue; } if ($configPath && $this->configUtils->getStoreConfig($configPath, $store->getId())) { return true; } } return false; } }