- Issue created by @ryanfc78
- Issue was unassigned.
- π§πͺBelgium flyke
If you have a commerce product type 'Product' and a commerce product variation type 'Product Variation' and a commerce product type 'Addon' and a commerce product variation type 'Addon variation', you will find the field formatter when editing the commerce product type 'Product' -> Manage Display -> in the dropdown next to your existing Variations field (not the newly added). So you change your existing Variations field formatter from 'Add to cart form' to 'Add to cart form with add-ons'.
- π§πͺBelgium flyke
Edit: After setting this up I noticed that I was no longer able to select product variations. I got this error when selecting a product variation:
Call to a member function getStore() on null in Drupal\commerce_cart\Form\AddToCartForm->selectStore() (line 48 of modules/contrib/commerce/modules/store/src/SelectStoreTrait.php).
I'm trying a different route now. Dont change anything for your Product or Product Type, but change your default Order Item Type.
For me its located at:/admin/commerce/config/order-item-types/default/edit/form-display/add_to_cart
.
I add an available accessories field there. Now its also available on the product page and selecting my variations at least still work this way.
But now I need to figure out how to actually add the selected items also to the cart.
Damn this module is hard to figure out and get working. - Status changed to Fixed
3 months ago 7:13pm 5 September 2024 - πΊπΈUnited States rhovland Oregon
π Commerce Product Add-on with layout builder gives error Fixed
Layout builder compatiblity has been addedBased on my understanding of the module before the patch I did recently was committed the formatter isn't an option for the variations field until you add a product reference field to the product type. After the change in the most recent version it's selectable but will give you a helpful error message now if you're missing a product reference field.
If you still need more help, please reopen this issue.
Automatically closed - issue fixed for 2 weeks with no activity.