Created
September 9, 2014 12:40
-
-
Save UberMouse/cca6f6e453f5c2337c41 to your computer and use it in GitHub Desktop.
Adds items to your countdown online shopping cart
This file contains 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
[ | |
//[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