Re: ShoppingCart clearing code

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57212
interpreted = N
texte = Hi I expanded Brian's suggestion a bit. I created a WebDNA page that looks in all the virtual sites in the WebSites folder, looks to see if they have a ShoppingCarts folder, and if they do, delete any carts older than 2 days. I set up a cron task to curl the page once a day in the wee small hours. I had to do a bit of fiddling with [moddate] to get it in a format I could do [math] on... ........................ [!] list all files in the WebSites folder[/!] [listfiles path=../WebSites/] [!] set variable for each file in loop[/!] [text]SiteName=[FileName][/text] [!] showif if there is a ShoppingCarts file inside[/!] [showif [FileInfo file=[SiteName]/ShoppingCarts][Exists][/fileinfo]=T] [!] look for carts to delete[/!] [listfiles path=[SiteName]/ShoppingCarts/] [!]check they are older than 2 days[/!] [showif [math]{[getchars start=7&end=10][ModDate][/getchars]/[getchars start=4&end=5][ModDate][/getchars]/[getchars start=1&end=2][ModDate][/getchars]}[/math]<[math]{[date %Y %m %d]}-2[/math]] [!]If so delete them[/!] [deletefile file=[SiteName]/ShoppingCarts/[FileName]] [!]/If so delete them[/!] [/showif] [!]/check they are older than 2 days[/!] [/listfiles] [!] /look for carts to delete[/!] [/showif] [!] /showif if there is a ShoppingCarts file inside[/!] [/listfiles] [!] /list all files in the WebSites folder[/!] ........................ Paul On 22 Mar 2004, at 19:30, Brian Boegershausen wrote: > why not just do a listfiles and delete anything over a day old. Put it > on > the purchase page so it does not go off thousands of times a day... > unless > you get that many orders. > > [listfiles path=shoppingcarts/] > [hideif [createdate]=[date]] > [deletefile file=[filename]] > [/hideif] > [/listfiles] > > That may need to be tweaked a bit, but you get the idea. > > Brian Boegershausen > ----- Original Message ----- > From: "Paul Willis" > To: "WebDNA Talk" > Sent: Monday, March 22, 2004 1:31 PM > Subject: ShoppingCart clearing code > > >> Hi all >> >> I have given up waiting for SMSI to fix the "ShoppingCart clearing >> code" bug in v5.1 (and I am not willing to pay $500 per copy for the >> fix) so I am going to roll my own. >> >> I faintly recall someone posting some code to do this a good while >> back >> (was it Alain?) but I can't find it in the archive. >> >> Anyone remember it? >> >> Paul >> ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: ShoppingCart clearing code ( Paul Willis 2004)
  2. Re: ShoppingCart clearing code ( "Brian Boegershausen" 2004)
  3. ShoppingCart clearing code ( Paul Willis 2004)
Hi I expanded Brian's suggestion a bit. I created a WebDNA page that looks in all the virtual sites in the WebSites folder, looks to see if they have a ShoppingCarts folder, and if they do, delete any carts older than 2 days. I set up a cron task to curl the page once a day in the wee small hours. I had to do a bit of fiddling with [moddate] to get it in a format I could do [math] on... ........................ [!] list all files in the WebSites folder[/!] [listfiles path=../WebSites/] [!] set variable for each file in loop[/!] [text]SiteName=[FileName][/text] [!] showif if there is a ShoppingCarts file inside[/!] [showif [FileInfo file=[SiteName]/ShoppingCarts][Exists][/fileinfo]=T] [!] look for carts to delete[/!] [listfiles path=[SiteName]/ShoppingCarts/] [!]check they are older than 2 days[/!] [showif [math]{[getchars start=7&end=10][ModDate][/getchars]/[getchars start=4&end=5][ModDate][/getchars]/[getchars start=1&end=2][ModDate][/getchars]}[/math]<[math]{[date %Y %m %d]}-2[/math]] [!]If so delete them[/!] [deletefile file=[SiteName]/ShoppingCarts/[FileName]] [!]/If so delete them[/!] [/showif] [!]/check they are older than 2 days[/!] [/listfiles] [!] /look for carts to delete[/!] [/showif] [!] /showif if there is a ShoppingCarts file inside[/!] [/listfiles] [!] /list all files in the WebSites folder[/!] ........................ Paul On 22 Mar 2004, at 19:30, Brian Boegershausen wrote: > why not just do a listfiles and delete anything over a day old. Put it > on > the purchase page so it does not go off thousands of times a day... > unless > you get that many orders. > > [listfiles path=shoppingcarts/] > [hideif [createdate]=[date]] > [deletefile file=[filename]] > [/hideif] > [/listfiles] > > That may need to be tweaked a bit, but you get the idea. > > Brian Boegershausen > ----- Original Message ----- > From: "Paul Willis" > To: "WebDNA Talk" > Sent: Monday, March 22, 2004 1:31 PM > Subject: ShoppingCart clearing code > > >> Hi all >> >> I have given up waiting for SMSI to fix the "ShoppingCart clearing >> code" bug in v5.1 (and I am not willing to pay $500 per copy for the >> fix) so I am going to roll my own. >> >> I faintly recall someone posting some code to do this a good while >> back >> (was it Alain?) but I can't find it in the archive. >> >> Anyone remember it? >> >> Paul >> ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Paul Willis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Unexpected error (1997) Euro Converter (1999) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Install Webcatalog under NT4.0 and Microsoft IIS 2.0 (1997) WebCat2b12plugin - [search] is broken ... not! (1997) pc (1997) Setting up shop (1997) WebCat & WebTen (1997) Bug Report, maybe (1997) categories and subcategories (2004) WCS Newbie question (1997) unusual search problem (1998) The Best Shopping Cart Solution I Have Come Upon (2003) WebCat Hosting (1998) webcat- multiple selection in input field (1997) I have observed and I am gone. (1998) Help needed! (1998) Relevancy Rating (1998) [WebDNA] WebDNA 4.5.1 process DBServer.exe memory allocation (2008) Transferring [cart] to Database (1997)