config = $config; $this->configUtils = $configUtils; $this->moduleManager = $moduleManager; } /** * @return bool */ public function isEnabled(): bool { if (! $this->config->isModuleEnabled() || ! $this->getAssociatedCategoryKey()) { return false; } if (! $this->moduleManager->isEnabled('Magento_DataServices')) { return false; } return true; } /** * Get key of associated cookie category. * * @param int|string|null $store * @return string */ public function getAssociatedCategoryKey($store = null): string { return (string) $this->configUtils->getStoreConfig(self::XML_PATH_CATEGORY_KEY, $store); } }