Last active
December 8, 2017 01:13
-
-
Save tiagomatos/03b984f00fe2577b0d3b5bda0474ce51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run in console for a Simple Product (without Product Variants): | |
// Jumpseller.addProductToCart(12345, 1, {}, {callback: addToCartCallback}); | |
<script type="text/javascript"> | |
function addToCartCallback(data) { | |
var sum = 0; // num of individual products in the cart. | |
$.each( data.products, function( index, product ){ | |
sum += product.qty; | |
}); | |
console.log('cart products sum:'); | |
console.log(sum); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment