extra Blank item addedgreenspun.com : LUSENET : S-Mart Shopping Cart : One Thread
When a new person enters my on-line mall and clicks on ordering something. It is added to the cart, but when the cart is shown the is a blank box above it with the price of $0.00. How can I stop this from being added to people carts?
-- Matt (firstname.lastname@example.org), February 06, 1998
The condition you describe occurs when a new customer comes to the store, or after a customer completes an order and then returns to the store -- in those circumstances there is no shopping cart file in the /tmp directory and so the script runs the sub make_file routine and puts the blank box and empty quantity and $0 price. I noticed that clicking the recalculate button at this point causes the item to disappear. With that in mind, I've found a workaround, which is to add the following line as the last line the the make_file subroutine
Put it just before the closing curly bracket. This causes an automatic recalculate as part of the routine that makes the shopping cart file, and you will get a nice tidy cart from then on.
-- Bob Orr (email@example.com), February 15, 1998.
Check your demo.db or whatever your database file is called. Look for extra blank lines at the end of it. I had this happen to me but it was because I had extra blank lines in my database.
Best of luck, Rob
-- Rob (firstname.lastname@example.org), April 13, 1998.
I call it the Hickup! I have S-Mart running on a bunch of sites and all of them have (had) it till I tried adding that &change_items tag in the sub routine or make_file!! Totally worked!! I was am not generating the pages so an extra space in the database file could not be the problem for my main site. Rock on Orr.
-- John WEbber (email@example.com), May 19, 2000.