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 1000 in 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 is specified 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 include is 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:

    
  1. Re: Cart # Starting at 1000 (Kenneth Grome 2000)
  2. Re: Cart # Starting at 1000 (Paul Fowler 2000)
  3. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  4. Re: Cart # Starting at 1000 (Kenneth Grome 2000)
  5. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  6. Re: Cart # Starting at 1000 (Kenneth Grome 2000)
  7. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  8. Re: Cart # Starting at 1000 (Kenneth Grome 2000)
  9. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  10. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  11. Re: Cart # Starting at 1000 (Paul Fowler 2000)
  12. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  13. Re: Cart # Starting at 1000 (WebDNA Support 2000)
  14. Re: Cart # Starting at 1000 (Brian B. Burton 2000)
  15. Re: Cart # Starting at 1000 (WebDNA Support 2000)
  16. Re: Cart # Starting at 1000 (Tony Frenzel 2000)
  17. Re: Cart # Starting at 1000 (Kenneth Grome 2000)
  18. Re: Cart # Starting at 1000 (WebDNA Support 2000)
  19. Cart # Starting at 1000 (Tony Frenzel 2000)
> 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 1000 in 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 is specified 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 include is 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:

Security problems (2000) WC2b15 File Corruption (1997) [WebDNA] I got v7 running on 64-bit Ubuntu 11.04 ... (2012) Yet another db manager (2004) extending webcatalog (1997) Associative lookup style? + bit more (1997) PROBLEM (1997) Nested tags count question (1997) Multiple Newcarts (1996) GrandTotal not right (1997) For those of you not on the WebCatalog Beta... (1997) Setting up shop (1997) Rollovers (1999) [OT] Startup E-Mail (2000) $Quit, $CloseDatabase corrections (1997) How long until WebDNA makes the list? :( (2004) WCS Newbie question (1997) [ShowCart] and GET vs. POST (1997) Reversed words (1997) Searching multiple Databases (1997)