getId()); $isActive = $subject->getIsActive(); // New active store or newly activated store or an active store switched store group if ($isActive && ($subject->getOrigData('is_active') !== $isActive || $this->isStoreGroupSwitched($subject)) ) { $websiteId = $subject->getWebsiteId(); if ($websiteId !== null) { $result[] = sprintf('%s_%s', ConfigIdentity::CACHE_TAG, 'website_' . $websiteId); $storeGroupId = $subject->getStoreGroupId(); if ($storeGroupId !== null) { $result[] = sprintf( '%s_%s', ConfigIdentity::CACHE_TAG, 'website_' . $websiteId . 'group_' . $storeGroupId ); } } } return $result; } /** * Check whether the store group of the store is switched * * @param \Magento\Store\Model\Store $store * @return bool */ private function isStoreGroupSwitched(\Magento\Store\Model\Store $store): bool { $origStoreGroupId = $store->getOrigData('group_id'); $storeGroupId = $store->getStoreGroupId(); return $origStoreGroupId != null && $origStoreGroupId != $storeGroupId; } }