// BugFix with shiping and warehouse
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11614 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+6
-4
@@ -1371,7 +1371,7 @@ class CartCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$warehouse_list = Warehouse::getProductWarehouseList($product['id_product'], $product['id_product_attribute'], $this->id_shop);
|
$warehouse_list = Warehouse::getProductWarehouseList($product['id_product'], $product['id_product_attribute'], $this->id_shop);
|
||||||
if (count($warehouse_list) == 0)
|
if (count($warehouse_list) == 0)
|
||||||
$warehouse_list = Warehouse::getProductWarehouseList($product['id_product'], $product['id_product_attribute']);
|
$warehouse_list = Warehouse::getProductWarehouseList($product['id_product'], $product['id_product_attribute']);
|
||||||
// Does the product is in stock ?
|
// Does the product is in stock ?
|
||||||
// If yes, get only warehouse where the product is in stock
|
// If yes, get only warehouse where the product is in stock
|
||||||
$warehouse_in_stock = array();
|
$warehouse_in_stock = array();
|
||||||
@@ -1435,10 +1435,12 @@ class CartCore extends ObjectModel
|
|||||||
|
|
||||||
// Determine the warehouse to use for this product in order to reduce the number of package
|
// Determine the warehouse to use for this product in order to reduce the number of package
|
||||||
$id_warehouse = 0;
|
$id_warehouse = 0;
|
||||||
foreach ($warehouse_count_by_address[$product['id_address_delivery']] as $id_warehouse)
|
foreach ($warehouse_count_by_address[$product['id_address_delivery']] as $id_warehouse => $val)
|
||||||
if (in_array($id_warehouse, $product['warehouse_list']))
|
if (in_array((int)$id_warehouse, $product['warehouse_list']))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
$id_warehouse = (int)$id_warehouse;
|
||||||
|
|
||||||
if (!isset($grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse]))
|
if (!isset($grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse]))
|
||||||
{
|
{
|
||||||
$grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse] = array();
|
$grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse] = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user