Hi all
I have an array which contains items for a shopping basket as such:
Array
(
[314:Black/Graphite-M] => Array
(
[quantity] => 1
[productprice] => 17.99
)
[314:Black/Graphite-L] => Array
(
[quantity] => 4
[productprice] => 17.99
)
[321:Bright@Blue/Blue-S] => Array
(
[quantity] => 3
[productprice] => 22.00
)
)
The array key contains the Product ID : Product Colour - Product Size values.
You can also see I store the quantitiy and product price against each of those keys.
What I need is help with is looping through this array and obtaining a count of all unique product id's and multiply them by the combined quantity assigned to the product ids.
So in the example array above, the result I need to get would be:
Product ID 314 has a total quantity of 5
Product ID 321 has a total quantity of 3
How on EARTH would I write a function that would pull this out??
Any advice would be greatly appreciated and save me hours of frustration.
regards
kbc