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:

RE: Languages (1997) [Price] (1997) [OT] Linux Vs. OSX (leopard) server (2007) Comments in db? (1997) No luck with taxes (1997) [/application] error? (1997) Re:Emailer and encryption (1997) problems with 2 tags (1997) autosensing lanague selection (1997) missing records (1998) WebCat2: Formulas.db question (1997) WebCat, The Trend, & Consolidating... (1997) Banners (1997) Linux vs Jaguar (OSX) (2002) calculating tax rates, mail order solutions and version 2 (1997) Reversing [ipaddress] normalization (1998) all records returned. (1997) Authenticate (1997) Error Log.db --however (1997) Quickie question on the email templates (1997)