This object is in archive! 

Can you make selecting a category required?

Archived Kevin W. 12 years ago

We are using the category option to identify our products. We have a lot of products and so we would prefer if the user was forced to pick a category. If that is not possible it would be better if the categories could be displayed first on the form instead of last. They are off the page when writing a response.

Replies (1)

photo
2

Hi, Kevin.


To make category option required open \application\modules\categories\handlers\Events.php and find the line 190 like this:

  1. $element = new System_Form_Element_MultiCheckbox($params);

Add after this line the following code:

  1. $element->setRequired();

Also you need to add your custom error messages, you can easily do it corresponding ZF manual.

Don't forget to add translation to \application\modules\categories\lang.php and clean the cache in admin area.

Replies have been locked on this page!