Re: Shipping Formula %

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 47486
interpreted = N
texte = Sales wrote:> Thank you, Marko, for your help: > > > [if ([subTotal]>0.00) & ([subTotal]<499.99)] > > [then]shipCost *.20[/then] > > [else] > > For some reason though, it doesn't work. I tried it as is,if you are using XML style () you will have to change the code to XML style.> I tried > changing [subTotal] in the first line to , I tried > removing shipCost from the formula since the formula is suppose to > give the shipCost value, and I got rid of all the carriage returns and > spaces like you said. But no luck. just results > in $0.00 on the Invoice.tpl page. > > A simple formula like *.10 does > work in the Formulas.db, but the If formula doesn't. Any ideas why?A properly typed nested if formula will work in the database just fine. Might want to check over your code again.> > > BTW, why do you use [subTotal] in the If statement, but > in the Then statement? Shouldn't they be the same? Also, are we > allowed to mix and match the old style syntax with the new?No.Marko has some text in the code that you will want to get rid of. [else]shipcost etc...You will need to change all [] to Rememeber, the Formula's database is looking for the first value it finds... so you will just want, for example, in the [then][/then] context, to result into a single number without text or spaces.Put it into the formulas.db like this:shipCostA trick that some people use is to create an include file and comment out the CR's.... ie your database would look like:shipCostthen your include file would be something like: do something do something do something else Donovan> > > Thanks again, > Marc > > *--*--*--*--*--*--*--*--*--*--*--*--*--*--* > Superior Shelving Systems > P.O. Box 6949 > Tacoma, WA 98406 > > 253-756-8138 > 253-752-1610 fax > > http://www.SuperiorShelving.com > > The Storage Shelving Specialists > Since 1984 > *--*--*--*--*--*--*--*--*--*--*--*--*--*--* > > ------------------------------------------------------------- > 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/ ------------------------------------------------------------- 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: Shipping Formula % (Marko Bernyk 2003)
  2. Re: Shipping Formula % (Rob Marquardt 2003)
  3. Re: Shipping Formula % (Donovan Brooke 2003)
  4. Re: Shipping Formula % (Sales 2003)
  5. Re: Shipping Formula % (Marko Bernyk 2003)
  6. Shipping Formula % (Sales 2003)
Sales wrote:> Thank you, Marko, for your help: > > > [if ([subTotal]>0.00) & ([subTotal]<499.99)] > > [then]shipCost *.20[/then] > > [else] > > For some reason though, it doesn't work. I tried it as is,if you are using XML style () you will have to change the code to XML style.> I tried > changing [subTotal] in the first line to , I tried > removing shipCost from the formula since the formula is suppose to > give the shipCost value, and I got rid of all the carriage returns and > spaces like you said. But no luck. just results > in $0.00 on the Invoice.tpl page. > > A simple formula like *.10 does > work in the formulas.db, but the If formula doesn't. Any ideas why?A properly typed nested if formula will work in the database just fine. Might want to check over your code again.> > > BTW, why do you use [subTotal] in the If statement, but > in the Then statement? Shouldn't they be the same? Also, are we > allowed to mix and match the old style syntax with the new?No.Marko has some text in the code that you will want to get rid of. [else]shipcost etc...You will need to change all [] to Rememeber, the Formula's database is looking for the first value it finds... so you will just want, for example, in the [then][/then] context, to result into a single number without text or spaces.Put it into the formulas.db like this:shipCostA trick that some people use is to create an include file and comment out the CR's.... ie your database would look like:shipCostthen your include file would be something like: do something do something do something else Donovan> > > Thanks again, > Marc > > *--*--*--*--*--*--*--*--*--*--*--*--*--*--* > Superior Shelving Systems > P.O. Box 6949 > Tacoma, WA 98406 > > 253-756-8138 > 253-752-1610 fax > > http://www.SuperiorShelving.com > > The Storage Shelving Specialists > Since 1984 > *--*--*--*--*--*--*--*--*--*--*--*--*--*--* > > ------------------------------------------------------------- > 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/ ------------------------------------------------------------- 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/ Donovan Brooke

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:

blank page from template (1997) V4, simultaneous release? (2000) Post size Limit? (1998) How to put the Trademark Symbol (%99) in Sendmail? (2003) French Webcat User (2002) format and math on the fly (1998) Summing fields (1997) Make sure I understand this??? (1997) Associative lookup style? (1997) Reserved word? (2005) Re:Running 2 two WebCatalog.acgi's (1996) Nested tags count question (1997) tcpconnect (1999) problem serving foreign languages text (1997) No luck with taxes (1997) Error:Too many nested [xxx] contexts (1997) webcat- multiple selection in input field (1997) Date sorting (1997) Alternating colors (1997) read and write you own cookies with webcat (1997)