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
https://forums.phpfreaks.com/topic/177128-need-major-help-from-a-php-session-guru/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.