I used to work with Drupal 7 Commerce and now I need help to work on D8 Commerce.
I have nodes on my D8 website and I need to sell them through Drupal Commerce. Each node can be sold in the same conditioning with four variations, based on customer types.
I have created a store, a product variation type, an attribute, a product type and one product with four variations, considering that one product would be enough.
Each node needs to be available as an order item. For that, I have added an entity reference field, linked to the product type. I have thus filled the default value with the product created.
Now on each node page, I have my add to cart button (through Commerce block or custom Views block, it works).
My problem :
Viewing the node A, I choose the variation and add the product in the cart and everything is fine.
Viewing the node B, I choose the exact same variation and add the product and there I need a second order item line with the node title (added through Views with relation to the entity reference field, not the issue here).
Unfortunately I get one order line item with quantity 2 (if I add the node title, I get two order line items with quantity 2 for each).
It may look obvious but I need to know if I really have to create one product with four variations for each node (2000+)?
Or is there a way to achieve this with D8 Commerce with only one product?
My concern here is to use properly Drupal Commerce and of course avoid the long multiple creation of products, especially in the future for my end user.
Related threads: