[pmwiki-devel] ZAP shopping cart question

The Editor editor at fast.st
Wed Nov 8 07:45:27 CST 2006


Hi all,

I have more a design question than a technical question, and seeking
some input from more experienced programmers.

The ZAP shopping cart system works great!  But--it saves each person's
order information in a page like this: Order.Caveman-2006-11-09.
There are some real problems however if they are not logged in.  ie,
it won't work.  Second, if they start their order before midnight
everything is erased when the clock strikes twelve. Third, if they
send a second order the same day, the old info is still there...

I'm thinking I need a better approach. Is there some kind of session
id # I could tap into that might make a better identifier?  Or perhaps
use an IP address?  Perhaps the best option might be a random number
or a time stamp, etc., that I store as a session variable (if it's not
already set) when the first item is added to the shopping cart.  When
the order is finally submitted, that session variable would be unset.
Perhaps I could keep the same general format, but use
Guest3493-2006-11-09 if they are not authenticated.

Any thoughts?  TIA all...

Cheers,
Caveman

PS.  I also use a bit of javascript to calculate prices, and allow
users to make last minute changes to their quantities, etc., before
submitting the checkout form to paypal.  Are there any thoughts on the
use of javascript for something like this? I know some don't like
it--but it works great...  See the cart & checkout snippets at
www.zapsite.com for an idea what it does.



More information about the pmwiki-devel mailing list