Re: Cart # Starting at 1000
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 30735
interpreted = N
texte = > Ok, now, because I'm slow at all of this, I'm getting confused. When you> say newOrderName below is that what I want it to be named, or is that> like a tag in this code were it has to be newordername?No, these are just local variables to hold this information for this script> Same thing with > lastordername (although I know I have to make an include file called> that. Can you give me example using fictitious file names?[!] wait for the cart file to be written to the orders folder[/!][waitforfile file=Orders/[cart]][!] Initiate and set the variable [newOrderName] to the contents of[/!][!] lastOrderName.txt + 1 (for the next sequential file name [/!][math show=f]newOrderName=1+[include file=/lastOrderName.txt][/math][!] Move(rename) the file from [cart] in the orders folder [/!][!] to the value of the variable [newOrderName] in the orders folder[/!][movefile from=Orders/[cart]&to=Orders/[newOrderName]][!] Write over the previous /lastOrderName.txt file with the next[/!][!] increment of your invoicing system[/!][writefile file=/lastOrderName.txt]][newOrderName][/writefile][/waitforfile]If you want your first order number to be 1001 then put only the text 1000in your lastOrderName.txt at the root level of your domain.> Also, what if > I have, or want .txt extensions for my file name.You can use any suffix for includes, but you probably want to keep away from.tpl .tmpl .db and so on.Your WebCatalog parsed files have to be named with a suffix that isspecified in your WebCat preferences under Allowed Template Extensions:,and set in your web servers mime typing.If you are using the plug-in version on a Mac then I know that your includeis processed as a hard coded piece of the page it is included in.Hope this helps,> > > - Tony the slow dood Frenzel> > > >>> >>> [waitforfile file=Orders/[cart]]>>> >>> [math show=f]newOrderName=1+[include file=lastOrderName][/math]>>> >>> [movefile from=Orders/[cart]&to=Orders/[newOrderName]]>>> >>> [writefile file=lastOrderName][newOrderName][/writefile]>>> >>> [/waitforfile]>>> >>> >>> ==>>>> Actually it's very easy, you just rename the cart file after it is>>> placed into the orders folder. Your webdna code goes at the bottom of>>> the thankyou.tpl page. In order to know the next>>> sequentially-numbered file name, you'll need to store the last one in>>> an include file named lastOrderName so you can use this code to set>>> the new file name and to update the lastOrderName value:> > > -------------------------------------------------------------> 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> -------------------------------------------------------------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
Associated Messages, from the most recent to the oldest:
> Ok, now, because I'm slow at all of this, I'm getting confused. When you> say newOrderName below is that what I want it to be named, or is that> like a tag in this code were it has to be newordername?No, these are just local variables to hold this information for this script> Same thing with > lastordername (although I know I have to make an include file called> that. Can you give me example using fictitious file names?[!] wait for the cart file to be written to the orders folder[/!][waitforfile file=Orders/[cart]][!] Initiate and set the variable [newOrderName] to the contents of[/!][!] lastOrderName.txt + 1 (for the next sequential file name [/!][math show=f]newOrderName=1+[include file=/lastOrderName.txt][/math][!] Move(rename) the file from [cart] in the orders folder [/!][!] to the value of the variable [newOrderName] in the orders folder[/!][movefile from=Orders/[cart]&to=Orders/[newOrderName]][!] Write over the previous /lastOrderName.txt file with the next[/!][!] increment of your invoicing system[/!][writefile file=/lastOrderName.txt]][newOrderName][/writefile][/waitforfile]If you want your first order number to be 1001 then put only the text 1000in your lastOrderName.txt at the root level of your domain.> Also, what if > I have, or want .txt extensions for my file name.You can use any suffix for includes, but you probably want to keep away from.tpl .tmpl .db and so on.Your WebCatalog parsed files have to be named with a suffix that isspecified in your WebCat preferences under Allowed Template Extensions:,and set in your web servers mime typing.If you are using the plug-in version on a Mac then I know that your includeis processed as a hard coded piece of the page it is included in.Hope this helps,> > > - Tony the slow dood Frenzel> > > >>> >>> [waitforfile file=Orders/[cart]]>>> >>> [math show=f]newOrderName=1+[include file=lastOrderName][/math]>>> >>> [movefile from=Orders/[cart]&to=Orders/[newOrderName]]>>> >>> [writefile file=lastOrderName][newOrderName][/writefile]>>> >>> [/waitforfile]>>> >>> >>> ==>>>> Actually it's very easy, you just rename the cart file after it is>>> placed into the orders folder. Your webdna code goes at the bottom of>>> the thankyou.tpl page. In order to know the next>>> sequentially-numbered file name, you'll need to store the last one in>>> an include file named lastOrderName so you can use this code to set>>> the new file name and to update the lastOrderName value:> > > -------------------------------------------------------------> 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> -------------------------------------------------------------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
Paul Fowler
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:
Emailer (1997)
[SearchString] usage (1997)
Nested tags count question (1997)
Need relative path explanation (1997)
getchars broken? (1997)
Append problem w/" (1999)
Extended [ConvertChars] (1997)
Interface to Quickbooks (2005)
[WebDNA] Sorry WebDNA server not running /Template ERROR/ Slow speeds (2019)
Order not created error (never mind) (1997)
[WebDNA] Admin Login Required to Serve any TPL Page (2009)
NT error logs (1997)
RE: Error reading data -1 (1997)
Questions on Mac WC 3.0.5b13 (2000)
Search returns all, not 20 (1997)
[WebDNA] Converting | to TAB (2010)
emailer setup (1997)
Protecting Realms (was: IIS Brain Dead) (1998)
b12 cannot limit records returned and more. (1997)
cart ID (1998)