// Merging multishipping branche on 1.5
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10259 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
8a1bd2eb2d
commit
5e6ab08a00
41 files changed
+2870
-889
No files matched your search
@@ -267,6 +267,30 @@ class WarehouseCore extends ObjectModel
|
||||
|
||||
return (Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query));
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given {product, product attribute} gets warehouse list
|
||||
*
|
||||
* @param int $id_product
|
||||
* @param int $id_product_attribute
|
||||
* @param int $id_shop
|
||||
* @return string
|
||||
*/
|
||||
public static function getProductWarehouseList($id_product, $id_product_attribute, $id_shop = null)
|
||||
{
|
||||
if (is_null($id_shop))
|
||||
$id_shop = Context::getContext()->shop->getID(true);
|
||||
|
||||
$query = new DbQuery();
|
||||
$query->select('wpl.id_warehouse');
|
||||
$query->from('warehouse_product_location wpl');
|
||||
$query->innerJoin('warehouse_shop ws ON (ws.id_warehouse = wpl.id_warehouse AND id_shop = '.(int)$id_shop.')');
|
||||
$query->where('id_product = '.(int)$id_product);
|
||||
$query->where('id_product_attribute = '.(int)$id_product_attribute);
|
||||
$query->groupBy('wpl.id_warehouse');
|
||||
|
||||
return (Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets available warehouses
|
||||
|
||||
Reference in new issue
Block a user