> foreach ($cart as $product_id => $quantity)
> {
>     echo $product_id . "<br>" . $quantity;
> }

The way you are accessing the array is incorrect. The $items array is a
property of the Cart object. Since the Cart object may have many different
array properties, the foreach statement above has to be sepcific about which
array you want to iterate through.

So the correct code would be:

foreach ($cart->items as $product_id => $quantity)
{
    echo $product_id . "<br>" . $quantity;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to