From d5573c94d972554b8f0a02bbf359fb4654bdd233 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Wed, 11 Jan 2012 14:35:38 +0000 Subject: [PATCH] // Fix combination add association --- classes/Combination.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/Combination.php b/classes/Combination.php index 75864f257..83a2f9482 100644 --- a/classes/Combination.php +++ b/classes/Combination.php @@ -112,7 +112,7 @@ class CombinationCore extends ObjectModel { $sqlValues = array(); foreach ($ids_attribute as $value) - $sqlValues[] = '('.(int)$value['id'].', '.(int)$this->id.')'; + $sqlValues[] = '('.(int)$value.', '.(int)$this->id.')'; $result = Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_attribute`, `id_product_attribute`) VALUES '.implode(',', $sqlValues) @@ -124,6 +124,9 @@ class CombinationCore extends ObjectModel public function setWsProductOptionValues($values) { + $ids_attributes = array(); + foreach ($values as $value) + $ids_attributes[] = $value['id']; return $this->setAttributes($values); } @@ -192,4 +195,4 @@ class CombinationCore extends ObjectModel { return parent::isCurrentlyUsed('product_attribute'); } -} \ No newline at end of file +}