amending existing shopping cart session array - help please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sjk1000
Forum Commoner
Posts: 26
Joined: Tue Nov 11, 2008 8:50 am

amending existing shopping cart session array - help please

Post by sjk1000 »

Hi All
I'm trying to display info from an existing session array but I'm not sure how to access it. The output from

Code: Select all

print_r ($_SESSION['cart']);  
is

shoppingCart Object ( [contents] => Array ( [13774] => Array ( [qty] => 2 ) [13933] => Array ( [qty] => 1 ) ) [total] => 45.99 [weight] => 0 [cartID] => [content_type] => physical [free_shipping_item] => 0 [free_shipping_weight] => 0 [free_shipping_price] => 0 [observers] => Array ( ) )
I haven't seen print_r return an Object like this before. Please could someone either give me a brief explanation, point me to a tutorial or give an example of how to echo the [13774]/[13993] quantities.
Any help is very much appreciated.
Many thanks, Steve
Post Reply