Skip to content

Commit

Permalink
Merge pull request #66 from techdivision/pac-5
Browse files Browse the repository at this point in the history
 Fix issue: Remove the tier price for all products that are available through the fired Listener
  • Loading branch information
kenza-ya authored May 14, 2024
2 parents d6df349 + 61f2d45 commit fd96930
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 26.1.1

## Bugfixes

* Fix issue: Remove the tier price for all products that are available through the fired listner
* Define a new method `addPrimarySkuToRowPkMapping` to map the SKU with the primary SKU of the row

## Features

* none

# Version 26.1.0

## Bugfixes
Expand Down
2 changes: 2 additions & 0 deletions src/Observers/EeProductObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use TechDivision\Import\Dbal\Utils\EntityStatus;
use TechDivision\Import\Product\Ee\Utils\MemberNames;
use TechDivision\Import\Product\Observers\ProductObserver;
use TechDivision\Import\Product\Utils\ColumnKeys;

/**
* Observer that create's the product itself for the Magento 2 EE edition.
Expand Down Expand Up @@ -48,6 +49,7 @@ protected function mergeEntity(array $entity, array $attr, $changeSetName = null
$this->setLastRowId($entity[MemberNames::ROW_ID]);
$this->setLastEntityId($entity[MemberNames::ENTITY_ID]);

$this->addPrimarySkuToRowPkMapping($entity[MemberNames::SKU], $entity[MemberNames::ROW_ID]);
// merge and return the entity
return parent::mergeEntity($entity, $attr, $changeSetName);
}
Expand Down
9 changes: 8 additions & 1 deletion src/Subjects/EeBunchSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace TechDivision\Import\Product\Ee\Subjects;

use TechDivision\Import\Product\Utils\RegistryKeys as ProductRegistryKeys;
use TechDivision\Import\Utils\RegistryKeys;
use TechDivision\Import\Product\Subjects\BunchSubject;
use TechDivision\Import\Product\Ee\Exceptions\MapSkuToRowIdException;
Expand Down Expand Up @@ -107,7 +108,13 @@ public function tearDown($serial)
$registryProcessor = $this->getRegistryProcessor();

// update the status up the actual import with SKU => row ID mapping
$registryProcessor->mergeAttributesRecursive(RegistryKeys::STATUS, array(RegistryKeys::SKU_ROW_ID_MAPPING => $this->skuRowIdMapping));
$registryProcessor->mergeAttributesRecursive(
RegistryKeys::STATUS,
array(
RegistryKeys::SKU_ROW_ID_MAPPING => $this->skuRowIdMapping,
ProductRegistryKeys::PRIMARY_SKU_TO_ROW_PK_MAPPINGS => $this->primarySkuToRowPkMappings
)
);

// call parent method
parent::tearDown($serial);
Expand Down

0 comments on commit fd96930

Please sign in to comment.