From e9aa77e96955851c1b8505e2d7267284beebf084 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Tue, 13 Aug 2024 16:29:45 +0200 Subject: [PATCH 1/3] PAC-903: add the enterprise variant --- .../EeStoreWebsiteValidatorObserver.php | 43 +++++++++++++++++++ symfony/Resources/config/services.xml | 4 ++ 2 files changed, 47 insertions(+) create mode 100644 src/Observers/EeStoreWebsiteValidatorObserver.php diff --git a/src/Observers/EeStoreWebsiteValidatorObserver.php b/src/Observers/EeStoreWebsiteValidatorObserver.php new file mode 100644 index 0000000..637bd09 --- /dev/null +++ b/src/Observers/EeStoreWebsiteValidatorObserver.php @@ -0,0 +1,43 @@ + + * @copyright 2024 TechDivision GmbH + * @license https://opensource.org/licenses/MIT + * @link https://github.com/techdivision/import + * @link http://www.techdivision.com + */ + +namespace TechDivision\Import\Product\Ee\Observers; + +use TechDivision\Import\Product\Msi\Utils\ColumnKeys; +use TechDivision\Import\Product\Observers\StoreWebsiteValidatorObserver; +use TechDivision\Import\Product\Utils\MemberNames; + +/** + * storeview validator callback implementation. + * + * @author MET + * @copyright 2024 TechDivision GmbH + * @license https://opensource.org/licenses/MIT + * @link https://github.com/techdivision/import + * @link http://www.techdivision.com + */ +class EeStoreWebsiteValidatorObserver extends StoreWebsiteValidatorObserver +{ + /** + * @return void + */ + public function setLastEntityRowId(): void + { + if (!$this->hasBeenProcessed($this->getValue(ColumnKeys::SKU))) { + $this->entity = $this->loadProduct($this->getValue(MemberNames::SKU)); + $this->setLastEntityId($this->entity[MemberNames::ROW_ID]); + $this->lastEntityId = $this->getLastEntityId(); + } + } +} diff --git a/symfony/Resources/config/services.xml b/symfony/Resources/config/services.xml index a1504fe..7bdc037 100644 --- a/symfony/Resources/config/services.xml +++ b/symfony/Resources/config/services.xml @@ -323,6 +323,10 @@ + + + + From 3d52bc0c239d1101eb7b4ea82382e5333b1d6d7b Mon Sep 17 00:00:00 2001 From: yamlahik Date: Mon, 2 Sep 2024 16:27:02 +0200 Subject: [PATCH 2/3] PAC-309: update changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90eb103..48892e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# Version 27.1.0 + +## Bugfixes + +* None + +## Features + +* New validation added, whether the product of the website is assigned to the current shop view line + * `"import.callback.store.in.website.validator"` + # Version 27.0.1 ## Bugfixes From e5d97d23c0122afa7e35d4d53e4aacbbcd832f2a Mon Sep 17 00:00:00 2001 From: yamlahik Date: Thu, 5 Sep 2024 15:22:27 +0200 Subject: [PATCH 3/3] PAC-309: compatibility code --- src/Observers/EeStoreWebsiteValidatorObserver.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Observers/EeStoreWebsiteValidatorObserver.php b/src/Observers/EeStoreWebsiteValidatorObserver.php index 637bd09..4fecbe7 100644 --- a/src/Observers/EeStoreWebsiteValidatorObserver.php +++ b/src/Observers/EeStoreWebsiteValidatorObserver.php @@ -1,7 +1,7 @@ * @copyright 2024 TechDivision GmbH @@ -32,10 +32,10 @@ class EeStoreWebsiteValidatorObserver extends StoreWebsiteValidatorObserver /** * @return void */ - public function setLastEntityRowId(): void + public function setLastEntityRowId($sku): void { - if (!$this->hasBeenProcessed($this->getValue(ColumnKeys::SKU))) { - $this->entity = $this->loadProduct($this->getValue(MemberNames::SKU)); + if (!$this->hasBeenProcessed($sku)) { + $this->entity = $this->loadProduct($sku); $this->setLastEntityId($this->entity[MemberNames::ROW_ID]); $this->lastEntityId = $this->getLastEntityId(); }