App reviews, troubleshooting, and recommendations
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
I am trying to get product info that is added to cart. Shopify.getCart() function returns undefined but opens an alert message saying "there is 1 item in the cart". How to get the cart details using this? any help appreciated
Hey @tsuj. Thanks for this question! I had the exact same one. Did you ever get this sorted out?
I can call the function but it always alerts the value, I just want to set it to a variable!
Turns out it's actually useless unless you do any tweak on the theme. I have used the ajax API for the same functionality. It's pretty flexible.
Shopify.getCart() returns a promise. So, you can use the following to get data:
Shopify.getCart(function (cart){
//here you have the cart object.
console.log(cart);
})
This won't fire up the alert.
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022