How to Create and Manage Attributes in OpenCart 2.0.x
Providing your customers with detailed and exhaustive information about the products they find in your store is a key component in the decision-making process each one of them goes before making a purchase. The default Product Comparison functionality of OpenCart makes this tedious task easier.
To make full use of this OpenCart feature, first you should make some configuration in the admin panel. When comparing products, OpenCart compares all of the product's characteristics, which you have configured through the admin panel of your store. But the most important information for the user are the technical specs, which distinct one product from another.
In OpenCart, this information is defined in the Attributes Tab of each product. To make full use of the Product Comparison feature, one should assign and organise the appropriate attributes to the corresponding Attribute groups.
In this post, we will guide you through the process of creating an attribute group, then assigning an attribute to the corresponding group. In the end, we will assign the items we created to a couple of products and see how they can come in handy at the front of your store.
For demonstration purposes, we will create attributes for two of the predefined products in OpenCart 2.0.x - MacBook and MacBook Air. To be as accurate as possible, I will use their official technical characteristics listed from Apple.
You can visit the official MacBook specs here - http://www.apple.com/macbook/specs/
Official Macbook Air specs - http://www.apple.com/macbook-air/specs.html
Creating attribute groups
Attribute groups combine all of the specs, which are usual for a certain component. To get a better idea, you can have a look at some of the predefined Attribute groups in OpenCart.
Go to Catalog->Attributes->Attribute Groups.
- Memory
- Motherboard
- Processor
- Technical
Let’s take the Processor attributes group for example. A processor is a single component of a computer, but it can have multiple characteristics. In OpenCart, these characteristics are individual attributes that you should assign to their corresponding attribute group. In our case, The “Processor” is the attribute, group. If you navigate to Catalog->Attributes->Attributes, you will see that there are several attributes assigned to it, such as Clock Speed and Number of cores and so on.
Creating Attribute group and assigning attributes
Now that we have clarified the main terms let's go through the process of creating an actual attribute group and assign an attribute to it.
Looking at the specifications of the two products we mentioned above let’s take the Display group for example. Each display has characteristics such as size, resolution, aspect ratio, display technology and so on. So, Display will be our attribute group.
To create a new Attribute group go to the upper right corner of your screen and hit the plus sign. A new configuration window will open. There are only two fields you need to fill.
- Attribute group name - in our case that would be “Display”
- Sort order - specify the sort order of this group.
Now that we have our attribute group let’s create its individual characteristics. Navigate to Catalog->Attributes->Attributes. To create a new one click on the plus sign at the upper right corner of the screen.
In the newly opened window, we have to specify the attribute name, the group it belongs to and again the sort order.
Following our example this would be
- Size
- Display
- Sort order.
Repeat the procedure for the rest of the attributes you think are essential for this attribute group.
To take advantage of the newly created attributes you have to assign them to a product. In our example, this would be MacBook and 11-inch MacBook Air.
Go to Catalog->Products. In my case, I will select MacBook. Click the edit button. The product edit screen will load. Navigate to the Attribute tab.
Here we can assign attributes to a product. Click on the plus button. An attribute field will load. Here you need to select the attribute you wish.
In our case, that would be “Size”. The next step is to give this attribute description.
That’s it. Now repeat this for all the attributes you want to add to the product.
After we are done configuring, and assigning attributes let’s see how they appear on the front of your store. Go to your store’s homepage and search for one of the products we mentioned in this tutorial. I will do that for the Macbook computer. Once you find it open its product page. All the attributes you have assigned will appear in the product “Specification” tab.
Now let’s compare the two products. Go to each of their pages and hit the “Compare button” next to the product photo.
Once you do this for both of the products, go to the comparison page. Here we will see how OpenCart compares the attributes we have just configured.
That’s it! We hope this tutorial gives enough information and provides a clear approach to OpenCart’s attribute system.