sum Quantity column by ID is Cart
I need to do a foreach loop in php so that by ID I can then sum the quantity of each (Unique) product variation in the cart.
So the ID of the product might be
12345 and the variation might be abc AND
12345 and the variation might be bcd AND
12345 and the variation might be cde
In this case it should return 3
foreach($Cart->Items as $item) {
//???
}
However, within the foreach loop, I am not sure how to complete the code. I have tried the obvious by $TotalProductVariations += $X8SCart->TotalColumn("Quantity")
But, this did not work.
Anyone had a go at this?