Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried adding an add to cart button to my all products view by adding product variation and choosing the add to cart form formatter. When I choose Rendered entity the variations are rendered correctly. I checked the logs but could not find any related messages.
Comments
Comment #2
bbuchert CreditAttribution: bbuchert as a volunteer commentedComment #3
vasikeI'm looking at this
It seems the issue it's about using AddToCartFormatter for "variations" field in Views.
Re-titled.
Comment #4
vasikeAnd there is a PR for this
https://github.com/drupalcommerce/commerce/pull/720
It seems that viewElements in formatter expects to return an Elements array
So i updated putting the "lazy_builder" inside "an element"
I also added some extra tests for MultipleCartFormsTest, using a second (new) View in "commerce_cart_test" module.
This view uses fields row type - variations field with "commerce_add_to_cart" formatter.
Comment #5
bbuchert CreditAttribution: bbuchert as a volunteer commentedIf I want to test this i need to use the latest dev version correct? I can't apply this to the latest release?
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedThanks!
Comment #9
bbuchert CreditAttribution: bbuchert as a volunteer commentedIt works for me only issue is that when I want to reuse the field as a token it seems not render. I opened another issue for this: https://www.drupal.org/node/2882542