// AdminWarehousesController: fixed association with carriers. Warehouse: fixed association with carriers. Carrier: norm & tags. AdminProductsController: added warning when using the advanced stock management without assocations with warehouses/carriers
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11582 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -175,6 +175,9 @@ class WarehouseCore extends ObjectModel
|
||||
*/
|
||||
public function setCarriers($ids_carriers)
|
||||
{
|
||||
if (!is_array($ids_carriers))
|
||||
$ids_carriers = array();
|
||||
|
||||
$row_to_insert = array();
|
||||
foreach ($ids_carriers as $id_carrier)
|
||||
$row_to_insert[] = array($this->def['primary'] => $this->id, 'id_carrier' => (int)$id_carrier);
|
||||
@@ -183,7 +186,8 @@ class WarehouseCore extends ObjectModel
|
||||
DELETE FROM '._DB_PREFIX_.'warehouse_carrier
|
||||
WHERE '.$this->def['primary'].' = '.(int)$this->id);
|
||||
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'warehouse_carrier', $row_to_insert, 'INSERT');
|
||||
if ($row_to_insert)
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'warehouse_carrier', $row_to_insert, 'INSERT');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user