diff --git a/classes/Product.php b/classes/Product.php index c70f2e82e..1a3620c55 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -1101,7 +1101,7 @@ class ProductCore extends ObjectModel $this->addSupplierReference($supplier_reference, $id_product_attribute); $result = ObjectModel::updateMultishopTable('Combination', array( 'wholesale_price' => (float)$wholesale_price, - ), 'id_product_attribute = '.(int)$id_product_attribute); + ), 'a.id_product_attribute = '.(int)$id_product_attribute); if (!$id_product_attribute || !$result) return false; @@ -1144,11 +1144,11 @@ class ProductCore extends ObjectModel { $result = ObjectModel::updateMultishopTable('Combination', array( 'default_on' => 1 - ), '`id_product` = '.(int)$this->id.' AND `id_product_attribute` = '.(int)$id_product_attribute); + ), '`id_product` = '.(int)$this->id.' AND a.`id_product_attribute` = '.(int)$id_product_attribute); $result &= ObjectModel::updateMultishopTable('product', array( 'cache_default_attribute' => (int)$id_product_attribute, - ), '`id_product` = '.(int)$this->id); + ), '`a.id_product` = '.(int)$this->id); return $result; } @@ -2762,7 +2762,7 @@ class ProductCore extends ObjectModel if (!$mini) return false; - if (!ObjectModel::updateMultishopTable('Combination', array('default_on' => 1), 'id_product_attribute = '.(int)$mini['id_attr'])) + if (!ObjectModel::updateMultishopTable('Combination', array('default_on' => 1), 'a.id_product_attribute = '.(int)$mini['id_attr'])) return false; return true; } @@ -3821,7 +3821,7 @@ class ProductCore extends ObjectModel return false; } - if ($has_required_fields && !ObjectModel::updateMultishopTable('product', array('customizable' => 2), 'id_product = '.(int)$this->id)) + if ($has_required_fields && !ObjectModel::updateMultishopTable('product', array('customizable' => 2), 'a.id_product = '.(int)$this->id)) return false; if (!$this->_deleteOldLabels()) diff --git a/classes/Search.php b/classes/Search.php index f8f99f1d7..11024c37f 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -574,7 +574,7 @@ class SearchCore protected static function setProductsAsIndexed(&$products) { if (count($products)) - ObjectModel::updateMultishopTable('Product', array('indexed' => 1), 'id_product IN ('.implode(',', $products).')'); + ObjectModel::updateMultishopTable('Product', array('indexed' => 1), 'a.id_product IN ('.implode(',', $products).')'); } /** $queryArray3 is automatically emptied in order to be reused immediatly */ diff --git a/classes/Tag.php b/classes/Tag.php index d60082b6f..e96621d35 100644 --- a/classes/Tag.php +++ b/classes/Tag.php @@ -192,7 +192,7 @@ class TagCore extends ObjectModel if (is_array($array)) { $array = array_map('intval', $array); - $result &= ObjectModel::updateMultishopTable('Product', array('indexed' => 0), 'id_product IN ('.implode(',', $array).')'); + $result &= ObjectModel::updateMultishopTable('Product', array('indexed' => 0), 'a.id_product IN ('.implode(',', $array).')'); $ids = array(); foreach ($array as $id_product) $ids[] = '('.(int)$id_product.','.(int)$this->id.')'; diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index f9d767423..270bacb08 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -246,7 +246,7 @@ class AdminPPreferencesControllerCore extends AdminController if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 1 && (int)Tools::getValue('PS_ADVANCED_STOCK_MANAGEMENT') == 0) { - ObjectModel::updateMultishopTable('Product', array('advanced_stock_management' => 0), '`advanced_stock_management` = 1'); + ObjectModel::updateMultishopTable('Product', array('advanced_stock_management' => 0), 'a.`advanced_stock_management` = 1'); Db::getInstance()->execute( 'UPDATE `'._DB_PREFIX_.'stock_available` diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index a89aa9050..7259e99b3 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2480,8 +2480,8 @@ class AdminProductsControllerCore extends AdminController 'wholesale_price' => (float)Tools::convertPrice($price, $id_currency) ); $where = ' - id_product = '.(int)$product->id.' - AND id_product_attribute = '.(int)$attribute['id_product_attribute']; + a.id_product = '.(int)$product->id.' + AND a.id_product_attribute = '.(int)$attribute['id_product_attribute']; ObjectModel::updateMultishopTable('Combination', $data, $where); } else