Commerce Pricing Attributes - What it is and how it works.
In early 2011 the world changed! That happened because Drupal 7 came into our lives and along with it Drupal Commerce, the brand new online e-shop tool. In the blink of an eye Drupal Commerce became viral creating a small sub-community on drupal.org and as a result a majority of Commerce oriented modules came to life very fast that expanded its capabilities furthermore. In Netstudio we immediately contributed in the Drupal Commerce ecosystem, not only with extra modules, but also with a Drupal Distribution based on it, called Open Deals. Drupal Commerce is widely accepted and trusted within the Drupal Developers community and managed till August of 2012 in London’s DrupalCon to cover almost every feature of Ubercart, which until then was an A-player for Drupal e-commerce solutions.
The problem
Even though as mentioned, Drupal Commerce covered 99% of Ubercart’s features, during its early lifetime showed a noticeable weakness that troubled a lot of the developers that wanted to use it on their web sites. The problem had to do with the multiple attributes per product which affected the final price. An example of this situation is the "pizza" product. Each pizzeria gives the opportunity to its customers to choose the ingredients that are going to be used in the making process and the final price is affected by each ingredient respectively. Until now Commerce handles this by creating each product’s combination as a different product in advance and by manually calculating each combination’s final price. If we assume that the "pizza" product has 5 different types of cheese, 5 types of sausages, 5 sauces and 5 types of vegetables then we had to create 5*5*5*5 = 625 different products! Each extra ingredient would increase by a great amount the number of the products that had to be created and also maintained. This is the main reason that even today many of the online shops are developed with Ubercart and not with Drupal Commerce.
The community's solution
There have been many efforts on a solution to the problem by the community of Drupal Commerce. Commerce Option Module introduced the product options idea and gave the opportunity to the site's administrator to create combinations of attributes. With this solution the administrator could then maintain a single product and the customer could keep combining the attributes on the final product. BUT, even though this was a respectable solution there were two unsolved problems. There should be the option of choosing different attributes per product. (for example some pizzas should have three possible cheese options available and some other should have two). Furthermore, and also the most important one is that there was not an option to affect the final price based on the attributes that have been chosen.
The Netstudio solution
In our company we have encountered many similar situations in the past year. Sometimes we were obliged to use Ubercart and some other times we had to implement custom solutions to comply with each demanded functionality. We finally agreed that there should be a more organized effort on building our own complete solution based on Drupal’s module system. Thus, Commerce Pricing Attributes was born. This module covers all of the possible situations of multiple product attributes. Each product can now have its own attributes and its own price per attribute. We achieved total flexibility as far as the product attributes is concerned and have marginally improved their management. Now, there is no need for maintaining hundreds or even thousands of products! So far, the module has received positive feedback and we have gathered some great ideas for further feature enhancement. You can visit the project’s page at https://www.drupal.org/project/commerce_pricing_attributes. We urge you to try it and send us your feedback or comments on further improvement. Here is a short video presentation of Commerce Pricing Attributes module with directions of the installation and configuration.