0
votes

I am new to Magento, and I have run into a problem with my store.

I am using configurable products for most of my items. The associated products often have a varying number of required attributes.

For example, one associated product may require- vehicle make, model, and year. Yet another associated product within the same configurable product may require- vehicle make, model, submodel, color, and year.

There lies my issue with configurable products. From my understanding, the dropdowns options are determined by the attributes that are selected when creating the configurable product. Regardless of whether or not the attribute is set to 'required', the attribute will become required if selected on this first menu.

However, not all of the products within the configurable product have the additional attributes, in my example- submodel and color.

Can you suggest a solution to this behavior? Or am I mistaken in the way Magento functions? Ideally I would have the drop down menus not required, and if empty, hidden from the product page.

My solution at this point is to simply use the unnecessary drop down menus by populating them with a 'All models' option.

The only other solution I could see is, modifying the product page and adding in code to retrieve the child attributes, and then check if they have values, and if not, hide them.

Thank you for your time.

1

1 Answers

1
votes

You are correct that the configurable product dropdown options are determined by the attributes selected when creating the configurable product. So one option would be to create multiple configurable products. One for simple products that have sub models and/or colors and others for simple products that do not.

Alternatively you might simply create attribute values for sub model and color that are 'null' or blank values. These might have values such as 'no options'. Then you can assign the 'no options' value for the sub model or color attribute of those simple products while assigning actual values for those that do have them. This way you could use one configurable product to contain all variations of the simple products.

Beyond that, if you want the dropdowns to completely disappear for models without sub models or colors you would need to create template overrides for the product page to hide those options with no values or the 'no options' values.