Skip to content

Instantly share code, notes, and snippets.

@aatronco
Created July 31, 2021 22:29
Show Gist options
  • Save aatronco/74d9b25a5565918fc25ab679665b3709 to your computer and use it in GitHub Desktop.
Save aatronco/74d9b25a5565918fc25ab679665b3709 to your computer and use it in GitHub Desktop.
let products = [7966034,7966035]; // Add products IDs here
// This may take a while, so it's better to create a loader
var setLoading = function(par){if(par){console.log("Inicio")}else{console.log("Inicio")}}
setLoading(true);
const addListToCart = (index, quantity) => {
if(index < products.length){
product = products[index];
Jumpseller.addProductToCart(product, quantity, {}, {callback: addListToCart(++index,quantity)})
}
else {
setLoading(false);
}
}
addListToCart(0, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment