Re: Counting LineItems

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31894
interpreted = N
texte = John That helps.When I use the example below I always get the last value 10 regardless of the value of [basket]. I think the showifs are --less than 3 then 15, more than 5 hide, greater than 2 then 12, end hide, greater than 5 then 10This makes sense but everytime I try it I get 10. Is there a doc anywhere i can read about how Webcat deals with the showif order?ThanksCharley Fresh Music---- NameFormula price[showif [basket]<3]15[/showif][hideif [basket]>5][showif [basket]>2]12[/showif][/hideif][showif [basket]>5]10[/showif] ---- (this would do what you asked for except for that last line - And if there were 4 or 5 line items the price would hold to $12 a CD. )-Johnchas wrote:> Wow, Thanks Brian, > > I'm half way there...... > > I've put a header in the shoppingcart.tpl that calculates lineitems and quantities. I just used [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > in the pricebreak.inc > and call view the text to see if its working. > > [Include file=pricebreak.inc] > [basket] > great! > > Now, I'm stumped because I know that [basket] returns the appropriate value and I tried the example below in the formulas.db....not happening... > ---- > Name Formula > price [lookup showif [basket]=1]price=15[/showif][showif [basket]=2]price is 15[/showif][showif [basket]=3]price = 12[/showif] > ---- > essentially I'm looking for the easiest way to build a case/if function to plug in to [price] > > Charley Conquest > Fresh Music > > --- You wrote: > I think there is a tag [totallineitems] or something to that nature, I > forget. > I have also used in the past > [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > You can also use this to set a header, then use the header in you > formulas.db to do your calculation. > [showif [header21]=1]price is 15[/showif] > [showif [header21]=3]price is 12[/showif] > etc > > ----- Original Message ----- > From: chas > To: WebCatalog Talk > Sent: Friday, May 12, 2000 3:20 PM > Subject: Counting LineItems > > Hi All, > > I'm just starting to use Webcatalog 3.08 on a Mac (OS-9) with Webstar 4.2. > > Based on the tea room I am selling compact discs. Every compact disc has a > unique name in the db. Every CD has a default [Price] value of $15. I want > to calculate a price based on quantity discounts. So if someone buys 1 CD (1 > lineitem) the price is $15. If they buy 3 CD's (3 lineitems) , I want the > price to go to $12 a CD ($36). If they buy 6 (6 lineitems), I want the price > to go to $10 a CD ($60). And if there were 4 or 5 line items the price > would hold to $12 a CD. > > I believe I need to find the value of the number of lineitems, and use this > value [xxx] in a lookup to the formula.db. > > Before I go mucking about, could someone steer me in the right direction on > this? > > Charley Conquest > Fresh Music > chas@valley.net > --- 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/ --- 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/ 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)
John That helps.When I use the example below I always get the last value 10 regardless of the value of [basket]. I think the showifs are --less than 3 then 15, more than 5 hide, greater than 2 then 12, end hide, greater than 5 then 10This makes sense but everytime I try it I get 10. Is there a doc anywhere i can read about how Webcat deals with the showif order?ThanksCharley Fresh Music---- NameFormula price[showif [basket]<3]15[/showif][hideif [basket]>5][showif [basket]>2]12[/showif][/hideif][showif [basket]>5]10[/showif] ---- (this would do what you asked for except for that last line - And if there were 4 or 5 line items the price would hold to $12 a CD. )-Johnchas wrote:> Wow, Thanks Brian, > > I'm half way there...... > > I've put a header in the shoppingcart.tpl that calculates lineitems and quantities. I just used [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > in the pricebreak.inc > and call view the text to see if its working. > > [Include file=pricebreak.inc] > [basket] > great! > > Now, I'm stumped because I know that [basket] returns the appropriate value and I tried the example below in the formulas.db....not happening... > ---- > Name Formula > price [lookup showif [basket]=1]price=15[/showif][showif [basket]=2]price is 15[/showif][showif [basket]=3]price = 12[/showif] > ---- > essentially I'm looking for the easiest way to build a case/if function to plug in to [price] > > Charley Conquest > Fresh Music > > --- You wrote: > I think there is a tag [totallineitems] or something to that nature, I > forget. > I have also used in the past > [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > You can also use this to set a header, then use the header in you > formulas.db to do your calculation. > [showif [header21]=1]price is 15[/showif] > [showif [header21]=3]price is 12[/showif] > etc > > ----- Original Message ----- > From: chas > To: WebCatalog Talk > Sent: Friday, May 12, 2000 3:20 PM > Subject: Counting LineItems > > Hi All, > > I'm just starting to use Webcatalog 3.08 on a Mac (OS-9) with Webstar 4.2. > > Based on the tea room I am selling compact discs. Every compact disc has a > unique name in the db. Every CD has a default [Price] value of $15. I want > to calculate a price based on quantity discounts. So if someone buys 1 CD (1 > lineitem) the price is $15. If they buy 3 CD's (3 lineitems) , I want the > price to go to $12 a CD ($36). If they buy 6 (6 lineitems), I want the price > to go to $10 a CD ($60). And if there were 4 or 5 line items the price > would hold to $12 a CD. > > I believe I need to find the value of the number of lineitems, and use this > value [xxx] in a lookup to the formula.db. > > Before I go mucking about, could someone steer me in the right direction on > this? > > Charley Conquest > Fresh Music > chas@valley.net > --- 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/ --- 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/ chas@valley.net (chas)

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:

Web Catalog 2 demo (1997) [WebDNA] Amazon EC2 (2009) WebCat2b13MacPlugIn - [include] (1997) Newbie questions (2000) [WebDNA] grep again (2010) Opinion: [input] should be called [output] ... (1997) NetCloak as Emailer substitute? (1999) The beginning (1997) OH MY GOD! (1998) Searching for a Blank Field (2000) WC2f3 (1997) Error Log.db --however (1997) Exclamation point (1997) ShipTotal Yet Again (1998) [BULK] RE: [WebDNA] WebDNA for Windows Newbie Questions (2008) XML WebDNA (2006) Back to Authnet with storebuilder (2003) Sum of Quantities (1997) problems with WebCat-Plugin (1997) Separate SSL Server (1997)