Hi,
I am using a multiple array stored within a session for a shopping cart.
I have overcome the following issues:
1) If items already is stored in shopping cart add 1 to the quantity
instead of adding another element to the array.
2) I can get the sum total of all the elements within the array. using
foreach($cart_items as $key=>$value)
{
$row=& $cart_items[$key];
$sumall[]=$row['priceid'];
}
$totalcopay=array_sum($sumall);
print '£'.$totalcopay;
What I want to achieve is to get the total of all the array elements and if the quantity is say 2 calculate this first.
Array elements are:
$cart_items[$i]['priceid']
$cart_items[$i]['name']
$cart_items[$i]['quantity']
Any ideas how I can achieve this?
Thanks Jamie