Jump to content

Remove "Add New" from back office Products


beamer

Recommended Posts

Prestashop vs 1.5.6

 

I am developing a shop that only sells virtual products and I have a rather unusual requirement.

 

I would like to remove the add new button from the back office admin catalog products page. This would force the catalog administrator to add a new product by using the duplicate product function. This is desirable since all the virtual products have at least  6 customizations and I need every product to have the same customizations.

 

I have tried to find the relevant file but without success, can anyone point me in the right direction as to which file I need to modify.

 

I did try and set the permissions for a catalog administrator to remove" add" Products but unfortunately this removed both the ability to add a new product and duplicate a product.

 

Any help would be gratefully appreciated.

Graham

Link to comment
Share on other sites

Hi thanks for the quick response. As I said in my original post I did try this but it also disables the duplicate product capability. I think i either need to modify the admin product page or add a new feature to permissions that distinguishes between add and duplicate.

 

If you can think of any other ways to achieve that would be great.

 

Graham

Link to comment
Share on other sites

  • 11 months later...

    -find below line in AdminProductsController.php:
     

  protected $tab_display_module;

        
    -and add below line after above line:

        protected $can_add_products = false;


    -find below lines:
   

public function postProcess()
    {
        if (!$this->redirect_after)
            parent::postProcess();

    
    and replace it with below:
 

  
    public function postProcess()
    {
        if (!$this->redirect_after)
            //parent::postProcess();
            
        if (!$this->can_add_products && $this->display == 'add')
            $this->redirect_after = $this->context->link->getAdminLink('AdminProducts');

        parent::postProcess();

    }
    

May be it works...

Thanks :)

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...