// Removing some id_warehouse

// Adding some checks with advanced_stock_management product attribute

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11375 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-12-19 16:01:41 +00:00
parent f1af46cfa6
commit 772147a6ee
10 changed files with 101 additions and 105 deletions
+5 -1
View File
@@ -448,6 +448,8 @@ class OrderCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT *
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.id_product = od.product_id
WHERE od.`id_order` = '.(int)($this->id));
}
@@ -606,7 +608,9 @@ class OrderCore extends ObjectModel
*/
protected function setProductCurrentStock(&$product)
{
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && (int)$product['id_warehouse'] > 0)
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
&& (int)$product['advanced_stock_management'] == 1
&& (int)$product['id_warehouse'] > 0)
$product['current_stock'] = StockManagerFactory::getManager()->getProductPhysicalQuantities($product['product_id'], $product['product_attribute_id'], (int)$product['id_warehouse'], true);
else
$product['current_stock'] = '--';