I have a multidimentional array that is generated by:
$('#order-submit').click(function(){
var orderResult = [];
$(".dynamic-sale").each(function(){
var individual_result = [];
$(this).find("select").each(function(){
individual_result.push($(this).val());
})
orderResult.push(individual_result);
});
It collects data from a dynamic form of shirt sales, and creates an array that looks like:
[[“3XL”, “1”, “15”], [“XL”, “1”, “15”]]
Which is the size, quantity and price per item for each row. I was able to calculate the total cost, but I’m having a hard time figuring out a way to get the total quantity of each item into a format that I can then add to an ajax call to submit to the database. How would I do that?
Thanks!
1 Answer