Jump to content

[SOLVED] removing side tabs from admin product editor?


sickshot

Recommended Posts

hello

 

in controllers / AdminProductsController.php near line ~97 you've got:

 

$this->available_tabs = array('Quantities' => 6, 'Warehouses' => 14);
 if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP)
  $this->available_tabs = array_merge($this->available_tabs, array(
   'Informations' => 0,
   'Pack' => 7,
   'VirtualProduct' => 8,
   'Prices' => 1,
   'Seo' => 2,
   'Associations' => 3,
   'Images' => 9,
   'Shipping' => 4,
   'Combinations' => 5,
   'Features' => 10,
   'Customization' => 11,
   'Attachments' => 12,
   'Suppliers' => 13,
  ));

 

try to manage the array elements, you will see how it works ;)

  • Like 2
Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...
  • 3 weeks later...

I have done this in the past using css, for example:

 

#link-Suppliers {display:none;} to remove the suppliers tab I was not using.

If you need to do this for different admin access levels, then you need conditional PHP to test the employee profile.

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
  • 7 months later...

hello

 

in controllers / AdminProductsController.php near line ~97 you've got:

 

$this->available_tabs = array('Quantities' => 6, 'Warehouses' => 14);
  if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP)
   $this->available_tabs = array_merge($this->available_tabs, array(
    'Informations' => 0,
    'Pack' => 7,
    'VirtualProduct' => 8,
    'Prices' => 1,
    'Seo' => 2,
    'Associations' => 3,
    'Images' => 9,
    'Shipping' => 4,
    'Combinations' => 5,
    'Features' => 10,
    'Customization' => 11,
    'Attachments' => 12,
    'Suppliers' => 13,
   ));
try to manage the array elements, you will see how it works ;)

 

 

 

Just for the record, i commented out those i didnt need and worked like a charm.

 

Thank you all.

Link to comment
Share on other sites

  • 1 month later...

I've tried the same thing in Prestashop 1.6.0.6.

 

I've removed the following tabs that I don't use. By adding // in front of each tab name in controllers/admin  AdminProductsController.php

Suppliers.

Features

Attachments

Combinations

Shipping

 

I don't use any of these tabs in my store or any of their content, If you don't use the content of any of these tabs on any product in your store it should be safe to remove/hide, although it's not recommended.

I could not remove the "Customization" tab since I could not save the products due to "link rewrite" error. So I recommend keeping that tab even if you don't use it.

 

Did a basic test of product creations, copy, sale, front and back office and I see no problems.

 

        // @since 1.5 : translations for tabs
        $this->available_tabs_lang = array(
            'Informations' => $this->l('Information'),
            'Pack' => $this->l('Pack'),
            'VirtualProduct' => $this->l('Virtual Product'),
            'Prices' => $this->l('Prices'),
            'Seo' => $this->l('SEO'),
            'Images' => $this->l('Images'),
            'Associations' => $this->l('Associations'),
            // 'Shipping' => $this->l('Shipping'),
            // 'Combinations' => $this->l('Combinations'),
            // 'Features' => $this->l('Features'),
            'Customization' => $this->l('Customization'),
            // 'Attachments' => $this->l('Attachments'),
            'Quantities' => $this->l('Quantities'),
            // 'Suppliers' => $this->l('Suppliers'),
            'Warehouses' => $this->l('Warehouses'),
        );

        $this->available_tabs = array('Quantities' => 6, 'Warehouses' => 14);
        if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP)
            $this->available_tabs = array_merge($this->available_tabs, array(
                'Informations' => 0,
                'Pack' => 7,
                'VirtualProduct' => 8,
                'Prices' => 1,
                'Seo' => 2,
                'Associations' => 3,
                'Images' => 9,
                //'Shipping' => 4,
                //'Combinations' => 5,
                //'Features' => 10,
                'Customization' => 11,
                //'Attachments' => 12,
                //'Suppliers' => 13,
            ));

Link to comment
Share on other sites

  • 1 year later...

hello

 

in controllers / AdminProductsController.php near line ~97 you've got:

 

$this->available_tabs = array('Quantities' => 6, 'Warehouses' => 14);
  if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP)
   $this->available_tabs = array_merge($this->available_tabs, array(
    'Informations' => 0,
    'Pack' => 7,
    'VirtualProduct' => 8,
    'Prices' => 1,
    'Seo' => 2,
    'Associations' => 3,
    'Images' => 9,
    'Shipping' => 4,
    'Combinations' => 5,
    'Features' => 10,
    'Customization' => 11,
    'Attachments' => 12,
    'Suppliers' => 13,
   ));

try to manage the array elements, you will see how it works wink.png

 

 

I LOVE YOU GUYS!!! It worked for me as well with commenting out thx =-)

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

What about hidding assocciations tab? I know it is necessary but it takes 15-30 seconds to load every time i save the product. For example if i want to add an specific price i have to wait to associations tab to load.

 

What i want to do is to disable the associations function and create a custom product to category associations script apart from product edition. When creating a product it will be assigned to a custom/hidden category and then i will move it to the correct one. 

 

I have about 10k categories and i know this is the main problem but while we create another category tree and assign our more than 250k products to them i think the commented above could be a solution.

 

What do you think?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

Hi,
We have purchase prestashop 1.7.1.2
Now the problem is i want to add new tab in the product edit page of backend. So i checked the package product  edit page code present in src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig

What is the right way to override this file?

Kindly suggest us.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...