Drupal 9 + Commerce + Layout Builder

Created on 27 February 2023, over 1 year ago
Updated 19 September 2024, 2 months ago

Has anyone used this with Drupal 9 + Commerce + Layout Builder. I have been playing around with it but can't seem to get it to work.

I don't see this step - Select 'Add to cart form with add-ons' for the Variations field

I just see the option for Add to cart form. Maybe I am just not doing one of the other steps correctly?
Any help would be appreciated.

πŸ’¬ Support request
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ryanfc78

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ryanfc78
  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡§πŸ‡ͺ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
  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    πŸ› Commerce Product Add-on with layout builder gives error Fixed
    Layout builder compatiblity has been added

    Based 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.

Production build 0.71.5 2024