Jump to content

Recommended Posts

Hi, our customer uses another software where they import all the products in PS, they also want to use the same ID(force ID enabled) as in the other software, therefore we want to disable manual adding of a product in admin. This way we won't get duplicates.

I've found a way to do this in /src/PrestaShopBundle/Controller/Admin/ProductController.php at line 353: 

 $toolbarButtons['add'] = array(
            'href' => $this->generateUrl('admin_product_new'),
            'desc' => $this->trans('New product', 'Admin.Actions'),
            'icon' => 'add_circle_outline',
            'help' => $this->trans('Create a new product: CTRL+P', 'Admin.Catalog.Help'),

So if I comment this out it works, but then when we update the PS this change will be gone. Is there a way to override this somehow, or manually hide it via css, or maybe with a hook?

Any help would be appreciated.

Edited by veijari (see edit history)

Share this post

Link to post
Share on other sites
  • 2 weeks later...
On 4/20/2020 at 4:32 PM, JBW said:

Why not remove the user rights to add new products?

@JBW That is a really good question! I have no idea why I did not come up with that easy solution..

Thank you for saving my time!

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More