Before exploring the process of creating attributes/options and applying them to products, make sure you understand this distinction. Attributes and their options are created on a global level with their own default settings. These are then applied to products individually after they're created (or during their creation when using product classes). The settings for attributes and options applied to products are specific to that product, and they default to the global defaults but may be adjusted on each product as need be. To get started, you'll need to make sure you have enabled the Attribute module. You must also be logged in as a user with access to administer attributes. You must create attributes and options globally before adding them to the products using the following steps.
Creating an attribute and its options:
- Browse to Administer > Store administration > Attributes.
- Click on the Add an attribute tab or link and fill in the form. In the case of the Ubercart Beanie, the name and label were entered as Size and the order was left at 0. Order determines the sorting of attributes on a product. Remember this is a default and may be overridden on each product if need be.
- Submit the form to create the new attribute.
- In the table of attributes, find the row for your new attribute and click on its operations link titled options.
- This page shows a table of existing attributes and includes a tab and link labeled Add an option that you use to access the form you use to add options to this attribute. Each option you add will appear on the product's add to cart form for this attribute. You don't have to enable every option for each product, but you must predefine any option here that you want to make available on your products. Here again you're setting up default values. The values for cost, price, and weight are flat value adjustments. These can be positive or negative numbers. In the case of the Ubercart Beanie, two options titled Small and Medium were added with empty values in the price and weight adjustments. A Large option was added with a $1.00 price increase associated by default with that option. Since the ordering of the options defaults to alphabetical order when all options have the same order value, the options were given order values of 1, 2, and 3 for Small, Medium, and Large respectively.
Assigning attributes and options to products:
- Browse to the product you want to affect and click on its Edit tab.
- This brings up the node edit form, but it also displays several sub-tabs for the edit page. Click on the on the Attributes tab.
- For products without attributes, there is a link in a table labeled add attributes to this product that you can click on to pull up an add attribute form. If you already have attributes on a product, you can use the add attributes form link in the help text to get to this same form. Here, using the Attributes select box, select the attribute(s) you want to add to this product and submit the form.
- If you need to adjust any of the attribute's settings for this product, do so in the table showing the attributes assigned to this product and click the Save changes button. Be aware that selecting a text field display will disregard the options you enable for the attribute except to fill in the text field with the default option if you have specified one.
- Now click on the Options tab.
- Here you will see a table for each attribute you have assigned to this product. It contains a listing of all the options associated with these attributes. When an attribute is added, all of its options are enabled by default. For each option, verify that the values set are correct, or disable any options that aren't available for this product. Here you may override the defaults and not affect any other product. You can also specify a default value to be selected already when the add to cart form is displayed for this product. If an attribute is marked as required, it will actually disregard the default selection so that customers are forced to look at this field and make their own decision.
- Submit the form when you have made all your selections and changes.