STRF-5640 - Load cart quantity in FE #1379
This is the first step in improving storefront performance by moving most/all Cart interactions to the frontend.
This change moves all functionality related to calculating the cart quantity in the header to FE API calls, after the initial HTML loads.
In future PRs, we'll be able to actually turn off the loading of Cart details in the HTML in Cornerstone, which will improve performance, especially for large carts. However, this PR does not disable Cart data, it simply introduces the FE behavior.
The "last known" cart quantity is cached in
Tickets / Documentation
GTM is our biggest use case. Delaying pushing data for the data layer changes what trigger executes the tag. The tag cannot fire on page load, DOM load, or window loaded. A custom event would need to be added to trigger once the API call came back.
Oh I see, so it is opt-in. Well, that kind of solves my problem, so maybe this is just a non-issue.