Skip to content

Commit

Permalink
Fix update bug on configurable product
Browse files Browse the repository at this point in the history
The current code do an array_diff between old and new attributes and call a 'set' method. It seems to be a mistake.

For configurable products, we just need to set newProductsIds as associated products.
  • Loading branch information
juliensnz committed Jan 7, 2014
1 parent 457dacf commit dd672a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/code/community/Bubble/Api/Helper/Catalog/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public function associateProducts(Mage_Catalog_Model_Product $product, $simpleSk

$usedProductIds = array_diff($newProductIds, $oldProductIds);

if (!empty($usedProductIds)) {
if ($product->isConfigurable()) {
$this->_initConfigurableAttributesData($product, $usedProductIds, $priceChanges, $configurableAttributes);
} elseif ($product->isGrouped()) {
$relations = array_fill_keys($usedProductIds, array('qty' => 0, 'position' => 0));
$product->setGroupedLinkData($relations);
}
if (!empty($newProductIds) && $product->isConfigurable()) {
$this->_initConfigurableAttributesData($product, $newProductIds, $priceChanges, $configurableAttributes);
}

if (!empty($usedProductIds) && $product->isGrouped()) {
$relations = array_fill_keys($usedProductIds, array('qty' => 0, 'position' => 0));
$product->setGroupedLinkData($relations);
}
}

Expand Down

0 comments on commit dd672a2

Please sign in to comment.