From 11971053735ee398c1f08d08befb17bde8e7b2b8 Mon Sep 17 00:00:00 2001 From: bMancone Date: Mon, 14 Nov 2011 10:11:48 +0000 Subject: [PATCH] // Stock : it is not possible to manage stock for a virtual product or a pack anymore git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10084 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/ajax_supplier_order_products_list.php | 1 + controllers/admin/AdminStockManagementController.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin-dev/ajax_supplier_order_products_list.php b/admin-dev/ajax_supplier_order_products_list.php index fdc385e94..4b6e527e3 100644 --- a/admin-dev/ajax_supplier_order_products_list.php +++ b/admin-dev/ajax_supplier_order_products_list.php @@ -62,6 +62,7 @@ $query->leftJoin('attribute_lang al ON (al.id_attribute = atr.id_attribute AND a $query->leftJoin('attribute_group_lang agl ON (agl.id_attribute_group = atr.id_attribute_group AND agl.id_lang = '.$id_lang.')'); $query->where('pl.name LIKE \'%'.$pattern.'%\' OR p.reference LIKE \'%'.$pattern.'%\''); $query->where('p.id_product NOT IN (SELECT pd.id_product FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))'); +$query->where('p.is_virtual = 0 AND p.cache_is_pack = 0'); if ($id_supplier) $query->where('p.id_supplier = '.$id_supplier); $query->groupBy('pa.id_product_attribute'); diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index 2960afebf..e28c21151 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -90,6 +90,7 @@ class AdminStockManagementControllerCore extends AdminController $this->_select = 'a.id_product as id, COUNT(pa.id_product_attribute) as variations'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.id_product = a.id_product)'; + $this->_where = 'AND a.cache_is_pack = 0 AND a.is_virtual = 0'; $this->displayInformation($this->l('This interface allows you to manage the stocks of each of your products and their variations.').'
'); $this->displayInformation($this->l('Total quantities in stock represent the sum for all warehouses.').'
'); @@ -939,10 +940,12 @@ class AdminStockManagementControllerCore extends AdminController $ean13 = $product->ean13; $name = $product->name; $manufacturer_reference = $product->supplier_reference; + $is_pack = $product->cache_is_pack; + $is_virtual = $product->is_virtual; } } - if ($product_is_valid === true) + if ($product_is_valid === true && $is_pack == false && $is_virtual == false) { // init form $this->initForm();