Zen Cart Logo
Forums / General Questions / Zencart and session variables..?

Zencart and session variables..?

Locked

Views: 2,408

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
17 Jan 2008, 1:58 AM
#1
flyingcoyote avatar

flyingcoyote

New Zenner

Join Date:
Jan 2008
Location:
In the mountains
Posts:
1
Plugin Contributions:
0

Zencart and session variables..?

I wanted to do something in an ajax-y way on the shopping cart page, so I tried the following, a type of approach I've used since the late 20th century:

  • created a div with an image in it

  • gave div an 'onclick' that does a javascript image swap on that image by calling a php page with a URL like 'sendbackimage.php?activateFeature=true' as the img src

  • sendbackimage.php attempts to set a session variable, then sends out header for a gif and returns an image appropriate to the value of 'activateFeature'

The 'sendbackimage' script is currently in the top level directory, and is just a few lines with no zc includes.

When I call the script by clicking the image in zencart's cart page, it returns the image correctly but the session var isn't set...as far as zencart is concerned...BUT - if I create another standalone page and navigate to it directly, IT sees my session variable but NOT the zencart ones. I can then click back to zencart pages and my session is still OK in there.

I want to know what special magic I have to do to set a session variable in zencart. I really don't want to refresh the page to do this.

This question may betray the fact that I really don't have a deep knowledge of session variables, but I did spend a good deal of time googling without learning enough to fix this...