// Improve stock managemetn and advanced stock management options and tab display on product admin interface
This commit is contained in:
@@ -74,7 +74,8 @@ class AdminPPreferencesControllerCore extends AdminController
|
|||||||
'validation' => 'isBool',
|
'validation' => 'isBool',
|
||||||
'cast' => 'intval',
|
'cast' => 'intval',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'type' => 'bool'
|
'type' => 'bool',
|
||||||
|
'visibility' => Shop::CONTEXT_ALL
|
||||||
),
|
),
|
||||||
'PS_DISPLAY_QTIES' => array(
|
'PS_DISPLAY_QTIES' => array(
|
||||||
'title' => $this->l('Display available quantities on product page:'),
|
'title' => $this->l('Display available quantities on product page:'),
|
||||||
|
|||||||
@@ -1687,18 +1687,24 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
// i is used as product_tab id
|
// i is used as product_tab id
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$advanced_stock_management_active = Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT');
|
$advanced_stock_management_active = Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT');
|
||||||
|
$stock_management_active = Configuration::get('PS_STOCK_MANAGEMENT');
|
||||||
|
|
||||||
foreach ($this->available_tabs as $product_tab)
|
foreach ($this->available_tabs as $product_tab)
|
||||||
{
|
{
|
||||||
if ($advanced_stock_management_active == 1 || ($advanced_stock_management_active == 0 && ($product_tab != 'Warehouses')))
|
// if it's the quantities tab and stock management is disabled, continue
|
||||||
{
|
if ($stock_management_active == 0 && $product_tab == 'Quantities')
|
||||||
$product_tabs[$product_tab] = array(
|
continue;
|
||||||
'id' => ++$i.'-'.$product_tab,
|
|
||||||
'selected' => (strtolower($product_tab) == strtolower($action)),
|
// if it's the warehouses tab and advanced stock management is disabled, continue
|
||||||
'name' => $this->available_tabs_lang[$product_tab],
|
if ($advanced_stock_management_active == 0 && $product_tab == 'Warehouses')
|
||||||
'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.Tools::getValue('id_product').'&action='.$product_tab,
|
continue;
|
||||||
);
|
|
||||||
}
|
$product_tabs[$product_tab] = array(
|
||||||
|
'id' => ++$i.'-'.$product_tab,
|
||||||
|
'selected' => (strtolower($product_tab) == strtolower($action)),
|
||||||
|
'name' => $this->available_tabs_lang[$product_tab],
|
||||||
|
'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.Tools::getValue('id_product').'&action='.$product_tab,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$this->tpl_form_vars['newproduct'] = 0;
|
$this->tpl_form_vars['newproduct'] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user