Skip to content

Commit b6c2522

Browse files
committed
Fixed tier price issue on configurable product
1 parent 1475eb2 commit b6c2522

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Customer\Api\GroupManagementInterface;
1616
use Magento\Framework\EntityManager\MetadataPool;
1717
use Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice;
18+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
1819

1920
/**
2021
* Process tier price data for handled existing product.
@@ -84,6 +85,10 @@ public function execute($entity, $arguments = [])
8485
{
8586
$attribute = $this->attributeRepository->get('tier_price');
8687
$priceRows = $entity->getData($attribute->getName());
88+
$origPrices = $entity->getOrigData($attribute->getName());
89+
if($entity->getTypeId() === Configurable::TYPE_CODE && null !== $origPrices){
90+
$priceRows = [];
91+
}
8792
if (null !== $priceRows) {
8893
if (!is_array($priceRows)) {
8994
throw new \Magento\Framework\Exception\InputException(
@@ -96,7 +101,6 @@ public function execute($entity, $arguments = [])
96101
$productId = (int)$entity->getData($identifierField);
97102

98103
// prepare original data to compare
99-
$origPrices = $entity->getOrigData($attribute->getName());
100104
$old = $this->prepareOldTierPriceToCompare($origPrices);
101105
// prepare data for save
102106
$new = $this->prepareNewDataForSave($priceRows, $isGlobal);

0 commit comments

Comments
 (0)