I am making a website that will have image canvas size as the products. As you know the Canvas Sizes will change and also their price will also change. Let me tell you the actual steps.

  1. The customer selects the Canvas Layout. These are the Products for me.
  2. The customer selects the sizes for the selected canvas layouts.
  3. The customer chooses the Wrap type for the Canvas.
  4. The customer chooses the color of the wrap.
  5. The customer chooses the Frame type of the Canvas.
  6. The customer chooses the color of the Frame.
  7. The customer adds the selected item to cart and go to checkout.

Please note that, once the customer starts customizing the product, the price of the product changes with each customization.

So my confusion is that, what will be the best suited practice to achieve this one. I am using Drupal Commerce. Should I go for the Product attributes or line items? Is there any way I can achieve this one by custom Module to add line items dynamically? So then I can create the prices upon each customization. I am attaching one wireframe about my idea.


2 Answers 2


If you made it all attributes (fields) on the products, created a product with each possible variation and referenced them all in a single node, it would work with the commerce add to cart form out of the box.

Commerce would create a select list for each attribute, which might not be exactly what you want, but that should be possible to handle with some form alter.


I think in this case you're inevitably going to have to do a fair amount of custom coding. I think the thing that needs thinking about is how you can best use Drupal Commerce to reduce the amount of coding you have to do.

This is by no means a definite how-to, it is however, how I'd would go about it in the first instance:

Create product types for each option that alters the price. If I understand correctly you would have four: 'Layout', 'Size', 'Wrap Type' and 'Frame Type'. The wrap type and frame type would also have a colour attribute. You can then create a product for each layout, size, wrap type and frame type.

That's all fairly easy an can be done through the UI. Obviously the default add to cart form won't be used, so the complexity comes in how you make up an order. By the looks of it there will be a 'wizard' for the user to make up their order. It would be out of the scope of this question to go into detail but it would essentially create an order with a line item referencing a product of each product type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.