// Fixed exceptions when saving products
This commit is contained in:
+5
-5
@@ -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())
|
||||
|
||||
+1
-1
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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.')';
|
||||
|
||||
Reference in New Issue
Block a user