I've got a foreach loop (returning the details of products in the cart). What it's returning is this (I've cut it down a bit):
array(2) {
[0]=>
array(4) {
["retailer"]=>
string(1) "2"
["productid"]=>
int(400)
["quantity"]=>
string(1) "1"
["discount"]=>
int(0)
}
[1]=>
array(4) {
["retailer"]=>
string(1) "2"
["productid"]=>
int(470)
["quantity"]=>
int(1)
["discount"]=>
int(0)
}
}
What I'd like is for the array key to be the retailer ID and the content to be the product information. Any idea how to resort this array?