diff --git a/CHANGELOG.md b/CHANGELOG.md index 56ee7e7..e078349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# Version 26.2.1 + +## Features + +### Optional product website store mapping validation + +* Add import parameter to make product website store mapping validation optional + # Version 26.2.0 ## Features diff --git a/src/Observers/StoreWebsiteValidatorObserver.php b/src/Observers/StoreWebsiteValidatorObserver.php index 7d727fa..8137498 100644 --- a/src/Observers/StoreWebsiteValidatorObserver.php +++ b/src/Observers/StoreWebsiteValidatorObserver.php @@ -18,6 +18,7 @@ use TechDivision\Import\Observers\StateDetectorInterface; use TechDivision\Import\Product\Msi\Utils\ColumnKeys; use TechDivision\Import\Product\Services\ProductBunchProcessorInterface; +use TechDivision\Import\Product\Utils\ConfigurationKeys; use TechDivision\Import\Services\ImportProcessorInterface; use TechDivision\Import\Product\Utils\MemberNames; use TechDivision\Import\Utils\RegistryKeys; @@ -87,6 +88,10 @@ public function __construct( */ public function process() { + if (!$this->getSubject()->getConfiguration()->getParam(ConfigurationKeys::VALIDATE_STORE_WEBSITE, true)) { + return; + } + $sku = $this->getValue(ColumnKeys::SKU); $storeViewCode = $this->getValue(ColumnKeys::STORE_VIEW_CODE); $productWebsites = $this->getValue(ColumnKeys::PRODUCT_WEBSITES, [], [$this, 'explode']); diff --git a/src/Utils/ConfigurationKeys.php b/src/Utils/ConfigurationKeys.php index f16cc96..5a60153 100644 --- a/src/Utils/ConfigurationKeys.php +++ b/src/Utils/ConfigurationKeys.php @@ -75,6 +75,13 @@ class ConfigurationKeys extends \TechDivision\Import\Utils\ConfigurationKeys */ const CLEAN_UP_LINKS = 'clean-up-links'; + /** + * Name for the configuration key 'validate-store-website'. + * + * @var string + */ + const VALIDATE_STORE_WEBSITE = 'validate-store-website'; + /** * Name for the column 'override-images'. *