I know someone is going to say that this is not a bug, in which case I'll change this to a support request.

Here's my problem:

I create an attribute. I DON'T check the box labelled "Make this attribute required, forcing the customer to choose an option."

I go to edit a product, I select the Attributes tab and I go to the add attributes form. I select the attribute that I want to add. I choose Add attribute. The new screen comes up. There is a checkbox for the attribute labelled 'Required'. I choose NOT to tick it.

Now I click the Options tab. There are two options, one adds £1 to the price, the other adds £2 to the price. Hey, I want the customer to have the choice of either, so I tick both and I click Submit. Now I get a warning; "All attributes with enabled options must specify an enabled option as default."

Fair enough, I think. No harm in a 'default', so I select the £1 option and make that the default and click Submit again. Happy days, I think.

So, now I select to View my product and while I'm waiting for the page to load, I consider what I've done:

1) I created an attribute and chose NOT to force the customer to choose an option,

2) I added that attribute to a product and stated that it is NOT required,

3) I configured the options for the attribute and chose a DEFAULT option

But what's this? I go to view the product. Sure the default option is selected. Sure the other option is available, but now the customer has NO WAY of not choosing one of these options. They ARE forced to choose an option. The attribute IS required.

Is it me, or is this wrong? Am I missing something?

Comments

Island Usurper’s picture

Status: Active » Closed (works as designed)

Heh, hadn't quite thought about it that way.

"Required" is used here in the Form API sense. The '#required' flag adds a default option ("Please select..."), and then doesn't accept it as a valid choice. The customer is "required" to consciously make a choice. Without the required setting, the customer might not pay attention and get whatever the default option is. They aren't required to choose because you've already done it. But they do have the option to change it.

Patrick Nelson’s picture

I can see that now, however, they don't have the option to choose nothing - to say, no, I don't want that optional extra - I guess the bottom line is that this is not what attributes are for.

andysmith’s picture

That makes perfect sense. Did you ever figure out a way?

Island Usurper’s picture

Add an option to the attribute that means "No thanks, I don't want this". Or now you can make them checkboxes.

andysmith’s picture

That makes perfect sense. Did you ever figure out a way?