uc_dropdown_attributes
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
If you do not already have a website for this module, for Drupal 6 you can download the UberDrupal installation profile. This contains Ubercart and all the other necessary modules. For Drupal 7 you will need to set up Drupal and Ubercart. Once the store is set up go to modules and turn on Attribute. Install uc_dropdown_attributes and go to modules and turn it on. Go to a product and edit it. There should be the following tabs: product, attributes, dependencies, options and adjustments. Go to the attributes tab and create a couple of attributes. Create options for each of the attributes. Add the attributes to the product. Now we are ready to define the attribute dependencies. Click on the dependencies tab. For each dependent attribute choose the attribute it depends on. The possible values for the attribute it depends on are displayed. Choose for which values you want the dependent attribute to appear. Save the dependencies. Then view the product and check to make sure the attributes are displayed when the appropriate value of the other attribute is selected.
The cart will display attributes that have a selected option. If the attribute is not required then it has a default selected option and will appear in the cart. For dependent attributes that may not be presented to the user this may not be what you want. Go to the dependencies tab and check the required box for the dependent attribute(s). Then the attribute will not have a default option and it will not appear in the cart if it was not displayed when the product was added to the cart.
For product classes, go to Store and then to Manage classes. Choose the Class ID for which you want to add attributes. Add the attributes and options. On the attributes tab do not make the dependent attributes required as this can cause a validation error; the other attributes may be checked as required. After you have finished adding your attributes on the Attributes tab, go to the Dependencies tab. Define which attributes are dependent attributes and only make those required on the dependencies tab. The dependent attributes must be required on the Dependencies tab otherwise they will appear in the cart even if they are never displayed to the user. Attributes other than dependent attributes should remain not required on the Dependencies tab.
Product dependencies override product class dependencies.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion