Category removed validation a root level on deletion | Category deletion

pankaj saxean asked on November 24, 2022 11:23

Hi team,

I'm not sure it is feasible to apply validation on categories module for removing the parent category, if the child categories exist. With proper message on the module area with provide provision to ask user if sure so click yes button else click no.

The message would be: "The category selected has subcategories associated with it. Would you like to delete the selected category?" with Yes and No buttons.

Recent Answers


Jeroen Fürst answered on November 24, 2022 13:45

Hi Pankaj,

This is not very easy but you could use the Global event handlers and add code that checks if it concerns a category that has child items and prevent if from being deleting.

This will only prevent the child items from being deleted but will not show a message dialog like you mentioned. You would therefor have to modify the categories module or make a copy and add the desired code. You could leverage the Action Confirmation of the UniGrid.

Hope this helps.

Cheers, Jeroen

1 votesVote for this answer Mark as a Correct answer

pankaj saxean answered on November 25, 2022 05:29

Hi Jeroen,

Thanks for your response using the Global event I have prevent the category delete. The only issue that the message not shown.

0 votesVote for this answer Mark as a Correct answer

Jeroen Fürst answered on December 8, 2022 08:51

Hi Pankaj,

Did you check out the Action Confirmation of the UniGrid? The alternative is that you would have to create a custom module that handles the desired behavior.

Cheers, Jeroen

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.