ATTRIBUTES, PRODUCTS AND VARIATIONS IN DRUPAL COMMERCE

Most e-commerce platforms support offering multiple product variations on a single product display page. These variations are often differentiated by named attributes, e.g. size, colour, etc. In Drupal Commerce, we support all of this through Product and ProductVariation entities paired with ProductAttribute and ProductAttributeValue entities that define those differentiating attributes in each variation. In addition, you can fully customize your product data model by adding fields of any Drupal field type to your products and variations.

Unlike many other platforms, Drupal supports virtually unlimited variations and attributes for any product. It may seem like a small thing, but keep in mind that Shopify, one of the largest e-commerce platforms in the world, only allows you to add 3 such attributes to your products, only supports entering options via free tagging, and offers no way to change the way attributes are represented in the "Add to Cart" form. All of this is elementary in Drupal Commerce thanks to the strengths of the Drupal data model.

In Drupal commerce we have a data structure based on entities related to each other, and fully translatable to all languages:

Products

Products (for example a t-shirt or a pair of pants) are an entity where you can specify several fields that are common in all variations. For example description, product name, images, technical characteristics, ...

Product variations

Variations are really what many customers understand as "products". It is what is being sold on the web. They have a unique SKU, fields that differentiate them from other variations of the same product and a price field.

This gives a lot of flexibility to for example have a product "t-shirt", and that its variations are the different sizes or colours.

Or for example, we can have a product "PC", and its variations can be: PC only, PC + screen, PC + screen + keyboard/mouse.

As I say, this gives us a lot of flexibility to make almost any e-commerce.

Attributes

Attributes are the values that differentiate each of the product variations.

Continuing with the example of the "T-shirt", the attributes would be the sizes and colours.

 e-commerce

Therefore, to clarify concepts and to continue with the example of a clothing store.

We would have a type of product that would be "T-shirts", some attributes that would be a list of colours and sizes, a specific product that would be "short sleeve T-shirt", a set of variations that would be the combinations of sizes and colours available for that product "short sleeve T-shirt".

drupal-commerce-hoodie

Once you have defined your product data model, you can configure how all those fields appear on the product display pages and Add to Cart forms. We provide a special feature called "field injection" that allows you to include auto-updating variation fields on the page, which means that fields such as images, prices, SKUs, etc. change to reflect the currently selected variation as the customer selects the attributes on the "Add to Cart form". In the demo product shown above, the images change as the colour is selected.

Tags

Have Any Project in Mind?

If you want to do something in Drupal maybe you can hire me.

Either for consulting, development or maintenance of Drupal websites.