Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Same question here, seems like it's not fired when items are added to the cart.
What is the best way to listen to cart updates using ScriptTag?
Same here, it looks like everybody is hijacking the "fetch" function to intercept the calls, but Shopify should have an API to avoid that.
Seems to work for me.
Added this mainly for people who have searched for Shopify.onCartUpdate
Some debugging ideas:
If you're working with someone else's theme maybe insert your script before the theme's script but after the vendors file.
Maybe your theme isn't using the Shopify library to update the cart. Below is one way to check.
What are you even talking about?
When I assigned a function to Shopify.onCartUpdate, it had no effect after adding an item to the cart.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025