Skip to content

Commit 5d954ee

Browse files
authored
PAC-966: Optional Product-Website validation (#191)
* PAC-966: Optional Product-Website validation
1 parent 909a9a5 commit 5d954ee

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Version 26.2.1
2+
3+
## Features
4+
5+
### Optional product website store mapping validation
6+
7+
* Add import parameter to make product website store mapping validation optional
8+
19
# Version 26.2.0
210

311
## Features

src/Observers/StoreWebsiteValidatorObserver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use TechDivision\Import\Observers\StateDetectorInterface;
1919
use TechDivision\Import\Product\Msi\Utils\ColumnKeys;
2020
use TechDivision\Import\Product\Services\ProductBunchProcessorInterface;
21+
use TechDivision\Import\Product\Utils\ConfigurationKeys;
2122
use TechDivision\Import\Services\ImportProcessorInterface;
2223
use TechDivision\Import\Product\Utils\MemberNames;
2324
use TechDivision\Import\Utils\RegistryKeys;
@@ -87,6 +88,10 @@ public function __construct(
8788
*/
8889
public function process()
8990
{
91+
if (!$this->getSubject()->getConfiguration()->getParam(ConfigurationKeys::VALIDATE_STORE_WEBSITE, true)) {
92+
return;
93+
}
94+
9095
$sku = $this->getValue(ColumnKeys::SKU);
9196
$storeViewCode = $this->getValue(ColumnKeys::STORE_VIEW_CODE);
9297
$productWebsites = $this->getValue(ColumnKeys::PRODUCT_WEBSITES, [], [$this, 'explode']);

src/Utils/ConfigurationKeys.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ class ConfigurationKeys extends \TechDivision\Import\Utils\ConfigurationKeys
7575
*/
7676
const CLEAN_UP_LINKS = 'clean-up-links';
7777

78+
/**
79+
* Name for the configuration key 'validate-store-website'.
80+
*
81+
* @var string
82+
*/
83+
const VALIDATE_STORE_WEBSITE = 'validate-store-website';
84+
7885
/**
7986
* Name for the column 'override-images'.
8087
*

0 commit comments

Comments
 (0)