The flyout's add to cart drop-in replacement provides some great performance benefits, however, it is not up to feature parity with the default add to cart form. We should remove the auto-swap so that the flyout and progressively decoupled cart block/form can still be used.

Case and point:
* #2998605: Support order item fields.
* #2993213: Support uneven variation attribute matrix.
* #3029048: Add support for Wishlist module

CommentFileSizeAuthor
#2 3029049-2.patch3.38 KBmglaman

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new3.38 KB

Here is a first patch, with an upgrade hook. This keeps existing sites on the proper field formatter.

mglaman’s picture

While we're at it, I think we should also move the formatter to a lazy builder as well. I've had New Relic on a site which uses the add to cart formatter in its catalog, where there is a 1:1 relationship to variations and no attributes.

Drupal\serialization\Normalizer\ContentEntityNormalizer::normalize was called ~45 times and took 4,040ms. However, this is probably on a fresh cache bust.

  • mglaman committed 80d1fa9 on 8.x-1.x
    Issue #3029049 by mglaman: Stop automatically swapping the default add...
mglaman’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

bensey’s picture

Hi there, I had some issues with this module and wanted to check in as to whether this issue is the same thing.

Basically when I created a view with teasers that all had "Add to cart" forms on them, when this module was enabled only the first form on the page/view worked. All the teaser's forms had the same variation options, but when I selected options on other forms in teasers it acually changed the radios on the first add to cart form. It was like each form didn't have a unique ID or something. There were no JS errors or issues to report however.

Uninstalling this module fixed that issue. But for some reason it also deleted the view, which was a little odd I thought.

mglaman’s picture

@bensey it's possible. And for the View... it's due to configuration dependencies.

I realized we need a change record for this.