cancel
Showing results for 
Search instead for 
Did you mean: 

Removing Delete option from Admin Dropdown in Catalog

Removing Delete option from Admin Dropdown in Catalog

I want to remove "Delete" action from magento admin panel. Someone else help me upload our products, and don't want them to be deleted accidentally in bulk. Please check screenshot.

 

 

 

2 REPLIES 2

Re: Removing Delete option from Admin Dropdown in Catalog

Hi,

I'm afraid that out of the box - this is not possible without any custom code.

 

You may find a plugin to do something like that and it'd probably be something to do with advanced admin permissions - however I've not had any experience with any so cannot advise you further.

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Removing Delete option from Admin Dropdown in Catalog

I'm not sure of your technical knowledge, but this question is in the programming section so I assume you are a coder.  Below outlines a few ways of doing it and thoughts on why some ways are better than others.   The goal when writing custom code is to have a minimal impact on the system.  Ideally, you only affect the code that needs changing.   

 

There are several ways you could accomplish this, all requiring some custom coding.  

 

This is  called a "Mass Action" and is added in the _prepareMassaction() function in this file:  /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php

 

You'll see a lot of people recommend that you move that file to/app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php and edit it.   However, that overwrites the entire file and if there are ever any upgrades in it, you will lose them.   

 

You can also create a custom module that rewrites that file and overwrites that function.  That's a step in the right direction as you lose a function instead of a file.  However, there's a better way.

 

If you look at the end of that _prepareMassaction, it throws an event "adminhtml_catalog_product_grid_prepare_massaction".   The preferred solution is to create a custom module, have it observe that event and in the observer remove the delete option.   

 

Here is a link to some code that does it this way: http://stackoverflow.com/questions/29584740/how-do-i-remove-a-massaction-from-the-product-grid-using...

Certified Plus Magento Developer | Top 50 Magento Contributor for 2017 | CEO/Founder at Jamersan | I make Magento videos at Ecommerce-aholic