Cart not deleted after successful order

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

I have the script running successfully at www.petesperfectpasta.com/index.html. Must use "index.html" as this site is not done. The problem is that after submitting an order, the shopping cart will not clear. I get the order, the receipt is sent to buyer, and everything else works.

Also, has anyone had success with deleting Tmp files. I have read every post, and there is not a solid response.

-Thanks!

-- Bryan Hollis (bryant@webmatter.net), April 15, 2000

Answers

Hi Bryan,

With regard to deleting tmp files, thank to a tip from CGI City, try this..

In smart.cgi find the lines: # Get the date &get_date; &get_host;

Add this line: &get_oldfiles;

Add this Subroutine to the script: sub get_oldfiles { ## OPEN AND READ THE TEMP DIRECTORY

opendir (DIR, "$tmpdir/"); @FILES = grep(/$storename/,readdir(DIR)); closedir (DIR);

## DELETE THE FILES THAT ARE OLDER THAN 1 DAY OR HOWEVER MANY ## YOU SPECIFY AS >

foreach $FILES (@FILES) { if (-M "$tmpdir/$FILES" > 1) { unlink("$tmpdir/$FILES"); } } }

-- Drew Watkins (drewwatk@aol.com), April 16, 2000.


One other thing, in the SMART.CFG file, change the $tmpdir = "/tmp" to $tmpdir = "tmp" and $orderdir = "/order" to $orderdir = "order".

* I've implemented cookie to the cart, send me a note at patrickccf@hotmail.com for further information.

--
God bless! :)

-- Patrick Chan (patrickccf@hotmail.com), April 16, 2000.


Moderation questions? read the FAQ