Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converted .size() to .length #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pbrink231
Copy link

.size() has been deprecated and this script fails to update the cart quantity after adding product to cart. Really needed since this is used on the official shopify documentation.
https://help.shopify.com/en/themes/customization/products/add-to-cart/stay-on-product-page-when-items-added-to-cart

.size() has been deprecated and this script fails to update the cart quantity after adding product to cart.  Really needed since this is used on the official shopify documentation.
https://help.shopify.com/en/themes/customization/products/add-to-cart/stay-on-product-page-when-items-added-to-cart
@pbrink231
Copy link
Author

.size() calls function { .length }. .length is the preferred method, faster and one less method call. Also deprecated in new versions. And lastly should be backward compatible in past jquery.

@rwschmitz
Copy link

Ran into the exact same issue just now and came to make this exact pull request, lol.

@drawcard
Copy link

drawcard commented May 3, 2020

Same here. Spent a few hours coming to this solution only to discover it's an unmerged PR. Thanks for providing it anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants