How to have an unique cart (very simple)

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

I have read some questions regarding the problem connected at ip address of the user. With a simple modification, it's possible to clear this problem. On smart.cgi find the line $reffile = "$tmpdir$delim$storename-$host"; and change in $xfile = time; $reffile = "$tmpdir$delim$storename$xfile; This allow to create a new file each time a user is coming. For reference, I don't know very well the script: I have just downloaded the script and now I make some modifications and translations. The idea of this cart is great, but I have found some problems (fixed myself) on admin and tracking script. For people need some assistance: you can write me servitel@servitelit.com

-- Roberto Pavesi (servitel@servitelit.com), May 26, 1999

Answers

You can do this also.

Find the following section in the SMART.CGI file:

sub get_host { $host = $ENV{'REMOTE_HOST'}; $reffile = "$tmpdir$delim$storename-$host"; }

Replace with the following lines:

sub get_host { $host = $ENV{'REMOTE_HOST'}; $p_id = ($$ % 10000); $reffile = "$tmpdir$delim$storename-$host-$p_id"; }

-- God bless!

-- Patrick Chan (patrickccf@hotmail.com), February 14, 2000.


I have implemented cookies with my cart. If you are interested to know more, email me at patrickccf@hotmail.com.

--
God bless!

-- Patrick Chan (patrickccf@hotmail.com), March 20, 2000.


Moderation questions? read the FAQ