// Fixed bugs when editing Warehouses & Suppliers for a product

This commit is contained in:
bMancone
2011-12-14 16:52:33 +00:00
parent 967749db9f
commit c686f0a876
2 changed files with 11 additions and 6 deletions
+10 -4
View File
@@ -188,6 +188,12 @@ class ProductCore extends ObjectModel
/*** @var array Tags */
public $tags;
/*
* @since 1.5.0
* @var boolean Product stock management type
*/
public $advanced_stock_management;
public $isFullyLoaded = false;
public $cache_is_pack;
@@ -4643,17 +4649,17 @@ class ProductCore extends ObjectModel
Search::indexation(false, $this->id);
return $success;
}
public static function getRealQuantity($id_product, $id_product_attribute = 0, $id_warehouse = 0, $id_shop = null)
{
static $manager = null;
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && is_null($manager))
$manager = StockManagerFactory::getManager();
if (is_null($id_shop))
$id_shop = Context::getContext()->shop->getID(true);
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && StockAvailable::dependsOnStock($id_product, $id_shop))
return $manager->getProductRealQuantities($id_product, $id_product_attribute, $id_warehouse, true);
else