diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php
index b42f21b3a..daff09871 100644
--- a/admin-dev/tabs/AdminProducts.php
+++ b/admin-dev/tabs/AdminProducts.php
@@ -56,11 +56,7 @@ class AdminProducts extends AdminTab
'a!active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'filter_key' => 'a!active', 'align' => 'center', 'type' => 'bool', 'orderby' => false));
/* Join categories table */
- if ($id_category = Tools::getvalue('id_category'))
- $this->_category = new Category($id_category);
- else
- $this->_category = new Category(1);
-
+ $this->_category = AdminCatalog::getCurrentCategory();
$this->_join = Product::sqlStock('a').'
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` AND i.`cover` = 1)
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product`)
@@ -183,7 +179,6 @@ class AdminProducts extends AdminTab
else
$this->_errors[] = Tools::displayError('You do not have permission to add here.');
}
- else
/* Delete a product in the download folder */
if (Tools::getValue('deleteVirtualProduct'))
@@ -193,7 +188,7 @@ class AdminProducts extends AdminTab
else
$this->_errors[] = Tools::displayError('You do not have permission to delete here.');
}
- else
+
/* Delete a product in the download folder */
if (Tools::getValue('deleteVirtualProductAttribute'))
{
@@ -1467,57 +1462,20 @@ class AdminProducts extends AdminTab
public function display($token = null)
{
- if (((Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndPreview') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitSpecificPricePriorities') OR Tools::isSubmit('submitPriceAddition') OR Tools::isSubmit('submitPricesModification')) AND sizeof($this->_errors)) OR Tools::isSubmit('updateproduct') OR Tools::isSubmit('addproduct'))
- {
- $this->displayForm($this->token);
- if (Tools::getValue('id_category') > 1)
- echo '
'.$this->l('Back to home').'
';
- else
- echo '
'.$this->l('Back to catalog').'
';
- }
- else
- {
- if ($id_category = (int)Tools::getValue('id_category'))
- AdminTab::$currentIndex .= '&id_category='.$id_category;
- $this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : null, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : null, 0, null, $this->context->shop->getID(true));
+ if ($id_category = (int)Tools::getValue('id_category'))
+ AdminTab::$currentIndex .= '&id_category='.$id_category;
+ $this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : null, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : null, 0, null, $this->context->shop->getID(true));
- $id_category = Tools::getValue('id_category', 1);
- if (!$id_category)
- $id_category = 1;
- echo '
'.$this->l('Go to category'); - $select_child = ' '; - echo $select_child; - echo '
- '; - //////////////////////// - $this->l('in category').' "'.stripslashes($this->_category->getName()).'"'; - if ($this->tabAccess['add'] === '1') - echo '
'.$this->l('Add a new product').'';
- echo '
'.$this->l('Add a new product').'';
+ echo '
'.$this->l('Increase your stock').'\');
$(\'#mvt_sign\').show();
}
- ';
- $tabpane = Media::getJqueryPluginPath('tabpane');
- $tabpane['css'] = key($tabpane['css']);
- echo '
-
+
+
+