Hi all
I've just written a VERY simple shopping cart system for my own joy and
edification as much as anything else. Mostly it was an exercise in learning
about sessions but I want to keep adding to it.
What happens at the moment is that it starts a session when the visitor
enters the site. As soon as the visitor adds something to their cart it
adds a row into a table where the session id is used as the unique
identifier in the table. The table also has columns for the product id and
price (joining tables will be my next learning curve)
One of the things I want to be able to do is affiliate tracking. The way I
have it in my head is that there will be an extra column for refid (or
something) so that:
www.whatever.com?refid=1234
will be used. 1234 will then get written to the table when the visitor
starts to add stuff to there cart.
What I need to know is
1. Is this reinventing the wheel? Is there a better way already
2. If the user hits the site and just looks around for a while, how do I
make sure that the refid variable is maintained until they add something to
their cart?
Hope this makes sense.
Andy