I have an array with products, and I want to add the sum of the products with same size. For example in my I array I have 5 Gal and 30 Gal sizes. I want the sum of total 5 Gals and 30 gals( in my array 5 Gal = 10 and 30 Gal = 9). I am too tired to figure out the method to give me this output...please help. Thanks!
array(7) {
[0]=>
object(stdClass)#223 (9) {
["size"]=>
string(6) "30 GAL"
["list_price"]=>
string(3) "614"
["count"]=>
string(1) "2"
}
[1]=>
object(stdClass)#224 (9) {
["size"]=>
string(5) "5 Gal"
["list_price"]=>
string(3) "131"
["count"]=>
string(1) "3"
}
[2]=>
object(stdClass)#225 (9) {
["size"]=>
string(6) "30 GAL"
["list_price"]=>
string(3) "727"
["count"]=>
string(1) "4"
}
[3]=>
object(stdClass)#226 (9) {
["size"]=>
string(5) "5 Gal"
["list_price"]=>
string(3) "138"
["count"]=>
string(1) "1"
}
[4]=>
object(stdClass)#227 (9) {
["size"]=>
string(6) "30 GAL"
["list_price"]=>
string(3) "804"
["count"]=>
string(1) "3"
}
[5]=>
object(stdClass)#228 (9) {
["size"]=>
string(5) "5 Gal"
["list_price"]=>
string(3) "176"
["count"]=>
string(1) "4"
}
[6]=>
object(stdClass)#229 (9) {
["size"]=>
string(5) "5 Gal"
["list_price"]=>
string(3) "182"
["count"]=>
string(1) "2"
}
}