// 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);
|
$this->addSupplierReference($supplier_reference, $id_product_attribute);
|
||||||
$result = ObjectModel::updateMultishopTable('Combination', array(
|
$result = ObjectModel::updateMultishopTable('Combination', array(
|
||||||
'wholesale_price' => (float)$wholesale_price,
|
'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)
|
if (!$id_product_attribute || !$result)
|
||||||
return false;
|
return false;
|
||||||
@@ -1144,11 +1144,11 @@ class ProductCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$result = ObjectModel::updateMultishopTable('Combination', array(
|
$result = ObjectModel::updateMultishopTable('Combination', array(
|
||||||
'default_on' => 1
|
'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(
|
$result &= ObjectModel::updateMultishopTable('product', array(
|
||||||
'cache_default_attribute' => (int)$id_product_attribute,
|
'cache_default_attribute' => (int)$id_product_attribute,
|
||||||
), '`id_product` = '.(int)$this->id);
|
), '`a.id_product` = '.(int)$this->id);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -2762,7 +2762,7 @@ class ProductCore extends ObjectModel
|
|||||||
if (!$mini)
|
if (!$mini)
|
||||||
return false;
|
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 false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -3821,7 +3821,7 @@ class ProductCore extends ObjectModel
|
|||||||
return false;
|
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;
|
return false;
|
||||||
|
|
||||||
if (!$this->_deleteOldLabels())
|
if (!$this->_deleteOldLabels())
|
||||||
|
|||||||
+1
-1
@@ -574,7 +574,7 @@ class SearchCore
|
|||||||
protected static function setProductsAsIndexed(&$products)
|
protected static function setProductsAsIndexed(&$products)
|
||||||
{
|
{
|
||||||
if (count($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 */
|
/** $queryArray3 is automatically emptied in order to be reused immediatly */
|
||||||
|
|||||||
+1
-1
@@ -192,7 +192,7 @@ class TagCore extends ObjectModel
|
|||||||
if (is_array($array))
|
if (is_array($array))
|
||||||
{
|
{
|
||||||
$array = array_map('intval', $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();
|
$ids = array();
|
||||||
foreach ($array as $id_product)
|
foreach ($array as $id_product)
|
||||||
$ids[] = '('.(int)$id_product.','.(int)$this->id.')';
|
$ids[] = '('.(int)$id_product.','.(int)$this->id.')';
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class AdminPPreferencesControllerCore extends AdminController
|
|||||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 1 &&
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 1 &&
|
||||||
(int)Tools::getValue('PS_ADVANCED_STOCK_MANAGEMENT') == 0)
|
(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(
|
Db::getInstance()->execute(
|
||||||
'UPDATE `'._DB_PREFIX_.'stock_available`
|
'UPDATE `'._DB_PREFIX_.'stock_available`
|
||||||
|
|||||||
@@ -2480,8 +2480,8 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
'wholesale_price' => (float)Tools::convertPrice($price, $id_currency)
|
'wholesale_price' => (float)Tools::convertPrice($price, $id_currency)
|
||||||
);
|
);
|
||||||
$where = '
|
$where = '
|
||||||
id_product = '.(int)$product->id.'
|
a.id_product = '.(int)$product->id.'
|
||||||
AND id_product_attribute = '.(int)$attribute['id_product_attribute'];
|
AND a.id_product_attribute = '.(int)$attribute['id_product_attribute'];
|
||||||
ObjectModel::updateMultishopTable('Combination', $data, $where);
|
ObjectModel::updateMultishopTable('Combination', $data, $where);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user