Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Storing a new session variable


matbennett

Recommended Posts

I'm hoping that someone can help me with the one small obstacle I still have in the way of a new mod that I am writing.

 

The mod is for a car-parts site. Simply put, users can store what car they drive and be given an option to show only products that fit their car. This means that rather than sifting through a list of a couple of hundred parts in one category, they just get shown the 2 or 3 that fit their car.

 

It's all coming together nicely at the moment, but once they have selected their car I would like to store this as a session variable so that they don't have to keep selecting it.

 

The problem is that I don't quite understand how osC handles session. I've sifted through the code a few times now, and am going bald from the head scratching! I've used sessions a bit before, but the code was nothing like what I am seeing here and I am determined to do this all the "osC way" so that it can be contributed when it is working.

 

Could someone give me an indication of what functions I should be using to:

 

1. Store a new variable

2. Retrieve that for comparisons

3. Clear it again

 

Many thanks in advance for any help, hints or pointer.

 

Mat

Link to comment
Share on other sites

Well, half of sessions.php is still totally lost on me, but if I ignore that half and stick with the familiar looking bits, it seems to work!

 

If anyone is interested in looking at this mod, drop me a PM. It's not in a contributable form yet, but it isn't all that far off. Eventually I would imagine that it could be used for anything where compatibility is an issue, although it is heavily geared to cars at the moment.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...