Skip to content

Commit aa8fc6d

Browse files
author
Yu Tang
committed
MAGETWO-28254: ConfigurableProduct Integration API
- Fix exception when an option is deleted
1 parent a966bf7 commit aa8fc6d

File tree

1 file changed

+6
-1
lines changed
  • app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute

1 file changed

+6
-1
lines changed

app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute/Collection.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ protected function _loadPrices()
263263
$values = $this->getPriceValues();
264264

265265
foreach ($values as $data) {
266-
$this->getItemById($data['product_super_attribute_id'])->addPrice($data);
266+
$item = $this->getItemById($data['product_super_attribute_id']);
267+
//the price values is cached, it could have gotten out of sync with current items
268+
//when a filter is added, in that case, we just ignore the data from the cache
269+
if ($item) {
270+
$item->addPrice($data);
271+
}
267272
}
268273
}
269274
return $this;

0 commit comments

Comments
 (0)