0

Is there a way to add a pick 3 max in the multiple select form in the custom options page? It's got required but not any other validation.

  • Can you elaborate more. The question is not much clear – Sukeshini Feb 5 '15 at 23:53
1

No, there isn't a way to define a minimum other than 1, or any maximum in Magento.

From a UI perspective, you could implement this on the front-end with JavaScript, (I don't think HTML has a way to define a maximum for multi-selects.) But it's obviously not very dynamic unless you're willing to target <select> by name, or apply the limitation to all of them.

As for back-end validation, you could always create an event observer and listen to sales_quote_product_add_after and remove the product from the cart, send an error to the session and redirect back the product page if they select too many values. (There isn't a sales_quote_product_add_before as far as I'm aware, which is annoying.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.