Skip to content

Instantly share code, notes, and snippets.

@UberMouse
Created September 9, 2014 12:40
Show Gist options
  • Save UberMouse/cca6f6e453f5c2337c41 to your computer and use it in GitHub Desktop.
Save UberMouse/cca6f6e453f5c2337c41 to your computer and use it in GitHub Desktop.
Adds items to your countdown online shopping cart
[
//[stock_code, quantity]
].forEach(function(product) {
var stock_code = product[0], quantity = product [1];
$.post('/Shop/AddToTrolley', {quantity: quantity, stockcode: stock_code}, function(data, status) {
if(status === "success") console.log(stock_code + " (" + quantity + ") succeeded");
else {
console.log(stock_code + " failed");
console.log({resp: data});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment