RE: Automatic Forwarding using WebCat
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13127
interpreted = N
texte = Michael ->I am writing a routine to make sure that files I am creating with a>CGI-ish program I>wrote have indeed been deposited in the StockRoom before I send the>customer to the Purchase page (this is to prevent file not found>errors). I am using [showif] and [hideif] to have>a page meta to itself until the files exist, at which point it metas to>the purchase page. Here's my idea for the code:Sure, the idea will work, though there were a few syntax errors. The trickiest part is making sure that [SKU] resolves to a correct value when you are checking the filenames -- you'll need to have the [listfiles] context inside the [orderfile] and [lineitems] contexts, so that every time it displays a line item from the cart, it goes through and checks all the files in your StockRoom folder for a file with a name of [SKU].[lineindex].Other things to mention (rest of original post is below) -- you don't need a [lineitems] context inside the [listfiles] context; it will loop through all files automatically.- you'll want to have [math] immediately around any variables you are setting, like [math]count=count+1[/math], rather than [math][lineitems]count=count+1[lineitems][/math]- You should probably put [MATH] inside an HTML comment so the values don't actually display on the page, e.g. - The
tag you'll want to use should look something like
I hope this proves helpful,Marc EagleStarNine Technologieshttp://www.smithmicro.com/>Set the variables...>>[math]testindex=0[/math]>[math]count=0[/math]>>Count the items in the order...>>[math][orderfile>cart=[cart]][lineitems]count=count+1[lineitems][/orderfile][/math]>>count the # of files in the StockRoom whose filenames match the items in >the order:>>[listfiles /StockRoom][lineitems][showif>filename=[SKU].[lineindex]][math]testindex=testindex+1[/showif][/lineitems]>>[/listfiles]>>Where [SKU].[lineindex] is the filename I'm looking for.>Then I conditionally show the META Command I want:>>[Showif count=testindex]
CONTENT=2;URL=Purchase.tmpl>[/Showif]>[Hideif count=testindex]
CONTENT=2;[thisURL]>[/Hideif]>>The body of the page contains a Please wait for your files to be>created... message and hopefully some amusing animated GIF.>>Is this crazy, or will it work? I'm sure I've got some errors in syntax,>if not concept. (probably an error in the META command, too--I've got to >check that)>>Another question is, do I really need to do this or is there some way I>can have WebMerchant keep trying to find the files to move to WebDelivery>until they appear?>>Please post your suggestions and answers, I greatly appreciate them.>>Thanks,>Michael Bohan>Music on Demand, LLC
Associated Messages, from the most recent to the oldest:
Michael ->I am writing a routine to make sure that files I am creating with a>CGI-ish program I>wrote have indeed been deposited in the StockRoom before I send the>customer to the Purchase page (this is to prevent file not found>errors). I am using
[showif] and
[hideif] to have>a page meta to itself until the files exist, at which point it metas to>the purchase page. Here's my idea for the code:Sure, the idea will work, though there were a few syntax errors. The trickiest part is making sure that [SKU] resolves to a correct value when you are checking the filenames -- you'll need to have the
[listfiles] context inside the
[orderfile] and
[lineitems] contexts, so that every time it displays a line item from the cart, it goes through and checks all the files in your StockRoom folder for a file with a name of [SKU].[lineindex].Other things to mention (rest of original post is below) -- you don't need a
[lineitems] context inside the
[listfiles] context; it will loop through all files automatically.- you'll want to have
[math] immediately around any variables you are setting, like
[math]count=count+1[/math], rather than
[math][lineitems]count=count+1
[lineitems][/math]- You should probably put
[math] inside an HTML comment so the values don't actually display on the page, e.g. [math]testindex=0[/math]>- The
tag you'll want to use should look something like
[thisurl]>I hope this proves helpful,Marc EagleStarNine Technologieshttp://www.smithmicro.com/>Set the variables...>>
[math]testindex=0[/math]>
[math]count=0[/math]>>Count the items in the order...>>
[math][orderfile>cart=
[cart]]
[lineitems]count=count+1
[lineitems][/orderfile][/math]>>count the # of files in the StockRoom whose filenames match the items in >the order:>>[listfiles /StockRoom]
[lineitems][showif>filename=[SKU].[lineindex]]
[math]testindex=testindex+1[/showif][/lineitems]>>[/listfiles]>>Where [SKU].[lineindex] is the filename I'm looking for.>Then I conditionally show the META Command I want:>>[Showif count=testindex]
CONTENT=2;URL=Purchase.tmpl>[/Showif]>[Hideif count=testindex]
CONTENT=2;
[thisurl]>[/Hideif]>>The body of the page contains a Please wait for your files to be>created... message and hopefully some amusing animated GIF.>>Is this crazy, or will it work? I'm sure I've got some errors in syntax,>if not concept. (probably an error in the META command, too--I've got to >check that)>>Another question is, do I really need to do this or is there some way I>can have WebMerchant keep trying to find the files to move to WebDelivery>until they appear?>>Please post your suggestions and answers, I greatly appreciate them.>>Thanks,>Michael Bohan>Music on Demand, LLC
Marc Eagle
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:
Online reference (1997)
WebCat2b13MacPlugIn - More limits on [include] (1997)
[FileInfo] (1998)
Emailer again (1997)
sorted cart? (1998)
searching illegal HTML (2002)
DB not found error (2004)
creating a ShipCosts database (1997)
Plugin or CGI or both (1997)
problems with 2 tags shakur (1997)
[WebDNA] Re-sending emails (2017)
RE: WebCatalog NT beta 18 now available (1997)
Error Log.db --however (1997)
C is for cookie - that's good enough for me... (2001)
creator code (1997)
[Fwd: Rotating Banners ... (was LinkExchange)] (1997)
WebCat2b15MacPlugin - [protect] (1997)
SKU lookup (1997)
Assigning carts (1998)
Shownext! (1998)