Product classes
Before we proceed, let's study one more concept: Product classes — they allow you to transform almost any Drupal content type into Ubercart products. So, how this is related to attributes? In a big store, usually there are product categories with different attribute groups. If you use only the default product content type, you have to assign all the available attributes to it, and select the correct attributes for each product separately. This is time-consuming and unproductive work, so using product classes you can create custom content types, and assign to them only selected attributes.
Let's take a look how we can do this:
1. First, create a new class at Home | Administer | Store administration | Products | Manage classes. Enter tshirts as Class ID, and T-shirts as Class name, and click on Submit.
2. Now, if you click on edit, you can add attributes and options for this product class. Let's select only the Color and keep all the available colors.
3. Go to http:/www.mysite.com/node/add/tshirts to create a new product belonging to the t-shirts product class. After the creation of this product you'll see that it has by default only the attributes and options that we selected in stage two, so we don't need to customize this section at all.
Product classes are a powerful feature of Ubercart. If you combine them with the two most popular third-party Drupal modules, cck and views, you can add custom fields to them. You can also create custom views and display each product class in a different way.
Average user rating: 5 stars out of 1 votes
Post a comment