0

We sell clothing items on one of our websites and I'm trying to update the error message a customer would receive if they tried to add a product to their cart without selecting a size from the size modifiers. Right now when a user tries to add an item without selecting the size modifier, they are redirected to a new page that reads:

The form you submitted contained the following errors: Store: Can't find product (entry ED: 190, modifiers {"56":"Select"})

I've tried looking into having the error displayed inline on the page, but I don't think I'm able to use error_handling="inline" in either of the following tags:

{exp:channel:entries

{exp:store:product

We aren't running the {exp:store:checkout tag on this particular page. Any ideas on how to accomplish this? I am also open to updated the default error message templates. I just need the error message to be more useful and say "Please select a size before adding the item to your cart."

Any help would be appreciated. Thank you!

1 Answer 1

0

That sounds like something you could validate on the front end when they hit the add to cart button without leaving the page. An html5 'required' attribute on the size selector will do the job, or there a number of fancier javascript validation libraries.

1
  • Thank you for the suggestions! I'm not sure the HTML5 'required' attribute will work in our current EE environment. I will look into some other javascript validations.
    – db123
    Commented Nov 1, 2017 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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