

Typical attributes for this product type are:Īnd some others, but for the purposes of this post, I will show you how to add these three.Īttributes are added in the same way as in the previous example concerning a T-shirt store. Laptops are one of the products found in electronics stores.

The last step is to change the settings in the attribute itself.Ĭhange the Element type to Rendered attribute and add hex values for individual colours.Īfter saving the settings on the page, the products – instead of an attributes/selection list – will be linked coloured squares. By clicking the settings cogwheel sign you can change the size of these squares or replace them with ovals. Thanks to this, coloured squares with colours to choose from will appear. In this case, you leave only the colour display and hide its name. This makes it possible to set the name of the colour and its HEX value when editing the attribute. The next step in the configuration is to change the display of the colour field in the tab for managing the appearance of the form, as well as the appearance of the field when the product is viewed. You can do it in the same way as you would for any other entity in Drupal. To achieve this effect, you need to add a new module – Colour FieldĪfter enabling the module, add a new field to the colour attribute. When you go to the main product page, the colour selection list will be visible.Ĭhange a selection list to links with colours The colour attribute can be found in the product variation creation form. Set different prices for different variations – you will see then that after changing the attribute the price will change automatically. Now create a new T-shirt product and add some variations to it to see how the attributes work. The list of attributes and the option of creating them is available inĪdd a new attribute by clicking the Add product attribute buttonĮlement type – for now, set the Select list,Īnd the product variation, to which it is to be linked – T-shirt,Īfter saving, add colour values as you like. The standard solution for colour choice is to create a linked colour, where – after clicking it – the appropriate variation of the product loads.ĭrupal Commerce lets you achieve this effect very simply. Two typical attributes for this type of store are colour and size. Product attributes for a T-shirt/clothing store If you set Create new in the variation field, after saving the new product type, by going toĬommerce → Configuration → Products → Product variation types you will see a new variation type. You can also choose an already existing variation type. → Product variation type – by checking Create new, a new variation type will be created automatically with the same name as the product type, in this case – T-shirt. → check that the product should have many variations Start by creating a new type of product – T-shirtįrom the admin menu Commerce → Configuration → Products → Product types Every variation can also have a different price. The attribute can be the T-shirt's colour or size. a T-shirt with the Droptica logo, and you add variations with different attributes to it. Thanks to this, you create one product, e.g. The product variation is associated with a reference to the product. You add new attributes to the product variation.
#Drupal commerce image display series#
This post is a continuation of the series covering the Commerce module used to add an e-commerce platform to Drupal Previous part from the basic Commerce configuration.

Thanks to this, the customer can easily add to the basket the product variant they are interested in, without having to switch to another subpage with a different product. You create one product, add a size and colour attribute, and create other versions of the same product. For example, when you sell your own original T-shirts, thanks to the attributes you do not have to add separate products when you want to add another shirt size or colour. We are a Drupal agency and we deal with it every day.Īttributes are the characteristics of given product types. We are happy to tell you how to easily add attributes to products for several selected industries. Check out how easily you can customise Drupal Commerce to sell any type of product. Every product type has different characteristics, e.g. When creating an e-commerce platform for a given industry, one needs to adapt the system to specific types of products. For the Commerce module introduction, please check our other article about Drupal Commerce. This article is talking about Product Attributes in Drupal Commerce.
