// Stock : it is not possible to manage stock for a virtual product or a pack anymore

This commit is contained in:
bMancone committed 2011-11-14 10:11:48 +00:00
1 parent 9df240f488
commit 9370253d88
2 files changed
+5 -1

No files matched your search

@@ -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->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('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.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) if ($id_supplier)
$query->where('p.id_supplier = '.$id_supplier); $query->where('p.id_supplier = '.$id_supplier);
$query->groupBy('pa.id_product_attribute'); $query->groupBy('pa.id_product_attribute');
@@ -90,6 +90,7 @@ class AdminStockManagementControllerCore extends AdminController
$this->_select = 'a.id_product as id, COUNT(pa.id_product_attribute) as variations'; $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->_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.').'<br />'); $this->displayInformation($this->l('This interface allows you to manage the stocks of each of your products and their variations.').'<br />');
$this->displayInformation($this->l('Total quantities in stock represent the sum for all warehouses.').'<br />'); $this->displayInformation($this->l('Total quantities in stock represent the sum for all warehouses.').'<br />');
@@ -939,10 +940,12 @@ class AdminStockManagementControllerCore extends AdminController
$ean13 = $product->ean13; $ean13 = $product->ean13;
$name = $product->name; $name = $product->name;
$manufacturer_reference = $product->supplier_reference; $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 // init form
$this->initForm(); $this->initForm();