Required Attributes not working

I want to force a decision - how do I do this?

Problem: When i set a attribute to an item like a color that must be specified and I enable the Required button on the attribute it is letting customers add items to the cart without giving a required attribute.

“Required” is only for “text” input fields. (Hence the description of “Text Required”). However, you can still set a default value for an attribute using one of the techniques described below.

To force selection of an attribute, there are two options:

  1. Create a “Please Select” option (for dropdowns)

    a. add an attribute that is Display-Only (ie: a color swatch that says “Please Select a Color”).

    b. make it the default. This forces the customer to choose something “other than” the default (since the “default” is set to “display only”).

    NOTE: This doesn’t work for checkboxes.

  2. Set a default value (for radio buttons)

    a. Go to the Attributes Controller and select the product in question (you will need to select the category, then the product, then press Display). The attributes will be shown below the product.

    b. Pick the attribute you want to be the default, and press the Edit button on the right side of that attribute.

    c. Set the Default Attribute to be Marked Selected: radio button to Yes.

    d. Press the Update button to save this change. 




Still have questions? No problem! Just head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified September 13, 2020 by Scott C Wilson (df12f195).