Created
July 31, 2021 22:29
-
-
Save aatronco/74d9b25a5565918fc25ab679665b3709 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
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