Jump to content

Freaking out with Session Objects - can someone help?


foreverdita

Recommended Posts


I have a page in which the print_r ($session) displays the following:

Array
(
    [securityToken] => 23b1f22bffd9f5097878618da57b14a2
    [cartID] => 
    [cart] => shoppingCart Object
        (
            [contents] => Array
                (
                )

            [total] => 0
            [weight] => 0
            [cartID] => 
            [content_type] => 
            [free_shipping_item] => 0
            [free_shipping_weight] => 0
            [free_shipping_price] => 0
        )

    [navigation] => navigationHistory Object
        (
            [path] => Array
                (
                    [0] => Array
                        (
                            

 => index
                            [mode] => NONSSL
                            [get] => Array
                                (
                                    [cPath] => 2_9_843_845_852_856_858_863
                                )

                            [post] => Array
                                (
                                )

                        )

                    [1] => Array
                        (
                            

 => product_info
                            [mode] => NONSSL
                            [get] => Array
                                (
                                    [cPath] => 2_9_843_845_852_856_858_863
                                    [products_id] => 2299
                                    [action] => add_product
                                )

                            [post] => Array
                                (
                                )

                        )

                    [2] => Array
                        (
                            

 => shopping_cart
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                    [3] => Array
                        (
                            

 => checkout_shipping
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                    [4] => Array
                        (
                            

 => checkout_payment
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                    [5] => Array
                        (
                            

 => checkout_confirmation
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                    [6] => Array
                        (
                            

 => checkout_process
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                    [7] => Array
                        (
                            

 => checkout_success
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )

                        )

                )

            [snapshot] => Array
                (
                )

        )

    [check_valid] => true
    [language] => english
    [languages_id] => 1
    [languages_code] => en
    [currency] => USD
    [today_is] => 2010-11-26
    [updateExpirations] => 1
    [session_counter] => 1
    [new_products_id_in_cart] => 2299
    [valid_to_checkout] => 1
    [cart_errors] => 
    [customer_id] => 2
    [customer_first_name] => test
    [customer_default_address_id] => 2
    [customer_country_id] => 223
    [customer_zone_id] => 2
    [customers_authorization] => 0
    [messageToStack] => 
    [payment_attempt] => 1
)

What I need to do is loop through the navigationHistory Object , grab the product id, and then get the cPath for that particular product id.  I have worked with sessions a lot, but I cannot seem to ever get the session object and loop thing down.  At this point I am ripping out my hair trying to figure out what is most likely a simple solution to this - can anyone help me?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.