Jump to content

Need major help from a php Session Guru


foreverdita

Recommended Posts

OK, this one is stumping me to no end.

 

Zen cart storing in session arrays.

 

One array, which I can access, is called the cart.  I can see it by doing a print_r($_SESSION['cart']);

 

The problem i am having is that within this cart array, there is another object called freeProduct.

 

I want to ONLY access the freeProduct array WITHIN the cart array.

 

The reason I want to do this is because I need to remove some of the session variables that are stored in this multidimensional array.

 

I have been strugglnig with this for almost two hours now, to no avail. 

 

Can some genius help moi?

Link to comment
Share on other sites

Perhaps this will give more information:

 

This is the print_r of the cart session.

 

What I need to be able to do is clear out (unset) the session beneath the cart that is called freeProduct Object.

 


[cart] => shoppingCart Object ( [contents] => Array ( [254:1b8a79c62ecfecf500c32bce6eb3d6a9] => Array ( [qty] => 1 [attributes] => Array ( [1] => 2 ) ) [412] => Array ( [qty] => 1 ) ) [total] => 3.25 [weight] => 4 [cartID] => 93181 [content_type] => physical [free_shipping_item] => 0 [free_shipping_weight] => 0 [free_shipping_price] => 0 [freeProductID] => 412 [observers] => Array ( [172b7d646c9d333e306482af66c329c0] => Array ( [obs] => freeProduct Object ( [freeAmount] => 1 [freeProductID] => 412 [observers] => Array ( ) ) [eventID] => NOTIFIER_CART_ADD_CART_END ) [4fb8d004a700b8316be4c1c3e4bb834c] => Array ( [obs] => freeProduct Object ( [freeAmount] => 1 [freeProductID] => 412 [observers] => Array ( ) )

 

In red is what I want to clear.

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.