You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.
This has come up with other Shopify themes based on Timber that use ajax-cart.js.liquid
The issue appears when modifying the cart when viewed in the pull out drawer on a theme like Brooklyn. When the last item of a cart line is removed, and the user clicks multiple times before the cart is updated, one of two things can happen.
If there is another line item after the item that was removed, the next item will be completely removed from the cart, no matter its quantity: https://screenshot.click/19-18-anfbg-iz6g7.mp4
Number 2 above can also trigger the first error, depending on how many times the [ - ] was clicked before the cart view is updated.
The Fix
Thankfully, the fix is quite simple. it involves utilizing the isUpdating boolean set and modified throughout other parts of the code in ajax-cart.js.liquid. Use this bool to prevent additional requests from being sent off until the cart has been updated. This prevents the Shopify API from trying to modify an item that is no longer present or make changes to the wrong line item.
The text was updated successfully, but these errors were encountered:
The Issue
This has come up with other Shopify themes based on Timber that use
ajax-cart.js.liquid
The issue appears when modifying the cart when viewed in the pull out drawer on a theme like Brooklyn. When the last item of a cart line is removed, and the user clicks multiple times before the cart is updated, one of two things can happen.
https://screenshot.click/19-15-17109-ef7qk.mp4
https://screenshot.click/19-18-anfbg-iz6g7.mp4
Number 2 above can also trigger the first error, depending on how many times the [ - ] was clicked before the cart view is updated.
The Fix
Thankfully, the fix is quite simple. it involves utilizing the
isUpdating
boolean set and modified throughout other parts of the code inajax-cart.js.liquid
. Use this bool to prevent additional requests from being sent off until the cart has been updated. This prevents the Shopify API from trying to modify an item that is no longer present or make changes to the wrong line item.The text was updated successfully, but these errors were encountered: