Re: Counting LineItems

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31935
interpreted = N
texte = how are you adding the item to the lineitems in the orderfile? Let's see the code. (You use an add command? or an addlineitem context?) The formula seems right so it should handle the pricing properly... something else is funny.If I don't respond for a while it may be because I am about to upgrade my system software... wish me luck ;-)-JohnPS (see below) -chas wrote:> Ahh such happiness!!.... got it to fire properly by putting the formula in the template. > > [math]zprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > zprice=[zprice] > > and adding [zprice] to the lineitem > [format 6.2f][zprice][/format] > [format 6.2f][price][/format] > > [zprice] calculates as expected..Great! > [price] returns 17.77 > > this last day and a 1/2 i could only return the final formula value (15 - 3 - 2 10) no matter what the quantity of [basket] when:and you are *certain* basket was what you thought it was for each test?> > > NameFormula > price[math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > > always returns 10 > > So i think there is some hinkyness in my calling the formula above.. so I added another entry into formula.db > and tried: > > nameformula > tprice[math]tprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math]again - it is not necessary to assing a variable in the formula itself. [math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] is sufficient. In fact the only reason the other even works at all is because [math] defaults to show the value of the variable you are assigning. If that is confusing then just use the formula without the tprice= or price=.Also our zprice was just for testing on a template. You will want to keep it named price in the formulas.db> > > and got > > [format 6.2f][zprice][/format] -this yielded $15.00 with 1 line - success > [format 6.2f][tprice][/format] -this yielded $00. 00 with 1 line - > > then tried > > nameformula > tprice[math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > > [format 6.2f][zprice][/format] -this yielded $15.00 with 1 line - success > [format 6.2f][tprice][/format] -this yielded $00. 00 with 1 line - > > I'am missing something essential... > > John P and John B thanks so much for the help! > > Charley Conquest > Fresh Music > > -- You wrote: > Chas, > > did you try John Peacock's neat formula? Does it behave now? > > If not then break the problem down into smaller pieces. Put that formula code in the template itself, but assign a variable to the price value so you can see what it is > later down. For example put this directly into the template- > > basket=[basket]
> [math]zprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > zprice=[zprice] > > see if you get what you think you should get. > > Now also see if you can get *any* formula to work. Try- > ---- > NameFormula > price17.77 > --- end of quote --- > > ------------------------------------------------------------- > 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://search.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Counting LineItems (chas@valley.net (chas) 2000)
  2. Re: Counting LineItems (John Butler 2000)
  3. Re: Counting LineItems (chas@valley.net (chas) 2000)
  4. Re: Counting LineItems (John Butler 2000)
  5. Re: Counting LineItems (chas@valley.net (chas) 2000)
  6. Re: Counting LineItems (John Butler 2000)
  7. Re: Counting LineItems (Kenneth Grome 2000)
  8. Re: Counting LineItems (chas@valley.net (chas) 2000)
  9. Re: Counting LineItems (John Peacock 2000)
  10. Re: Counting LineItems (chas@valley.net (chas) 2000)
  11. Re: Counting LineItems (chas@valley.net (chas) 2000)
  12. Re: Counting LineItems (kalin@el.net 2000)
  13. Re: Counting LineItems (kalin@el.net 2000)
  14. Re: Counting LineItems (Kenneth Grome 2000)
  15. Re: Counting LineItems (kalin@el.net 2000)
  16. Re: Counting LineItems (kalin@el.net 2000)
  17. Re: Counting LineItems (John Butler 2000)
  18. Re: Counting LineItems (John Peacock 2000)
  19. Re: Counting LineItems (chas@valley.net (chas) 2000)
  20. Re: Counting LineItems (John Butler 2000)
  21. Re: Counting LineItems (John Butler 2000)
  22. Re: Counting LineItems (John Butler 2000)
  23. Re: Counting LineItems (John Peacock 2000)
  24. Re: Counting LineItems (chas@valley.net (chas) 2000)
  25. Re: Counting LineItems (John Butler 2000)
  26. Re: Counting LineItems (chas@valley.net (chas) 2000)
  27. Re: Counting LineItems (Brian Boegershausen 2000)
  28. Counting LineItems (chas@valley.net (chas) 2000)
how are you adding the item to the lineitems in the orderfile? Let's see the code. (You use an add command? or an addlineitem context?) The formula seems right so it should handle the pricing properly... something else is funny.If I don't respond for a while it may be because I am about to upgrade my system software... wish me luck ;-)-JohnPS (see below) -chas wrote:> Ahh such happiness!!.... got it to fire properly by putting the formula in the template. > > [math]zprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > zprice=[zprice] > > and adding [zprice] to the lineitem > [format 6.2f][zprice][/format] > [format 6.2f][price][/format] > > [zprice] calculates as expected..Great! > [price] returns 17.77 > > this last day and a 1/2 i could only return the final formula value (15 - 3 - 2 10) no matter what the quantity of [basket] when:and you are *certain* basket was what you thought it was for each test?> > > NameFormula > price[math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > > always returns 10 > > So i think there is some hinkyness in my calling the formula above.. so I added another entry into formula.db > and tried: > > nameformula > tprice[math]tprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math]again - it is not necessary to assing a variable in the formula itself. [math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] is sufficient. In fact the only reason the other even works at all is because [math] defaults to show the value of the variable you are assigning. If that is confusing then just use the formula without the tprice= or price=.Also our zprice was just for testing on a template. You will want to keep it named price in the formulas.db> > > and got > > [format 6.2f][zprice][/format] -this yielded $15.00 with 1 line - success > [format 6.2f][tprice][/format] -this yielded $00. 00 with 1 line - > > then tried > > nameformula > tprice[math]15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > > [format 6.2f][zprice][/format] -this yielded $15.00 with 1 line - success > [format 6.2f][tprice][/format] -this yielded $00. 00 with 1 line - > > I'am missing something essential... > > John P and John B thanks so much for the help! > > Charley Conquest > Fresh Music > > -- You wrote: > Chas, > > did you try John Peacock's neat formula? Does it behave now? > > If not then break the problem down into smaller pieces. Put that formula code in the template itself, but assign a variable to the price value so you can see what it is > later down. For example put this directly into the template- > > basket=[basket]
> [math]zprice=15[ShowIf [basket]>2]-3[/showif][ShowIf [basket]>5]-2[/ShowIf][/math] > zprice=[zprice] > > see if you get what you think you should get. > > Now also see if you can get *any* formula to work. Try- > ---- > NameFormula > price17.77 > --- end of quote --- > > ------------------------------------------------------------- > 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://search.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://search.smithmicro.com/ John Butler

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:

Version 2.0 and 1.6 simultaneous (1997) WebMerchant & WebDelivery (2003) WebCommerce: Folder organization ? (1997) creating a ShipCosts database (1997) Showif, Hideif reverse logic ? (1997) Multiple prices (1997) 2.0 Beta (1997) searchable list archive (1997) Dreamweaver MX (again) (2002) [FileInfo] strangeness (1998) No luck with taxes (1997) ShowNext for method=POST (1997) [OT] Linux -> Winderz (2005) WebCatalog stalls (1998) Interfacing WebMerchant to www.fedex.com (1997) Separate SSL Server (1997) Remove (2000) is [Bankres] an internal webcat variable? (1999) absolute paths for databases? (1997) [foundItems] context problem (2000)