Re: Counting LineItems

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 32362
interpreted = N
texte = For one thing, the formulas.db is only used by WebCat itself for the fields listed on the doc page (price, taxable, etc.). You cannot just come up with a new variable and expect WebCat to know what to do with it. Your line will always display 0 because it is trying to subtract the string [discount] from the [subtotal], then format it.It is usually better to add a new line item for any discount, rather than trying to work outside of WebCat's system. Put a [addlineitem] on the page after you have calculated the total items and put your lookup there. Add a negative price and quantity 1...HTHJohn Peacock chas wrote: > > Hi, > > I'm back with a new iteration of relating quantity to discount. > > thanks to previous help John P,B,Brian I can carry a value of lineitems/quantity around in a header with - starting from the shoppingcart.tpl: > > [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > > then basket get put into a header: > > [SetHeader cart=[cart]]header40=[basket][/SetHeader] > > [header40] returns the right value on Invoice.tpl > > The problem is..... > > I want to apply a discount based on the value of [header40] > > here is what I have inserted after and outside the [lineitems][/lineitems] > > > Quantity Discount! > $[format .2f][subtotal]-[discount][/format] > > > in formulas.db I have a line: > nameformula > > discount[lookup db=discount.db&lookInField=[quant]&value=[header40]&returnField=realprices¬Found=0] > > and a sample of discount.db looks like this > > quant listprice level discamnt realprices > 15959059 > 2 118 59 0 118 > 3 177 46.33 38.01 138.99 > 4 236 46.33 50.68 185.32 > and many many more.... > > where discamnt is the value i want subtracted from the subtotal. > > I get 0 always....in Quantity Discount! > > TIA > > Charley Conquest > Fresh Music > > ------------------------------------------------------------- > 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)
For one thing, the formulas.db is only used by WebCat itself for the fields listed on the doc page (price, taxable, etc.). You cannot just come up with a new variable and expect WebCat to know what to do with it. Your line will always display 0 because it is trying to subtract the string [discount] from the [subtotal], then format it.It is usually better to add a new line item for any discount, rather than trying to work outside of WebCat's system. Put a [addlineitem] on the page after you have calculated the total items and put your lookup there. Add a negative price and quantity 1...HTHJohn Peacock chas wrote: > > Hi, > > I'm back with a new iteration of relating quantity to discount. > > thanks to previous help John P,B,Brian I can carry a value of lineitems/quantity around in a header with - starting from the shoppingcart.tpl: > > [text]basket=[math]0[lineitems]+[quantity][/lineitems][/math][/text] > > then basket get put into a header: > > [SetHeader cart=[cart]]header40=[basket][/SetHeader] > > [header40] returns the right value on Invoice.tpl > > The problem is..... > > I want to apply a discount based on the value of [header40] > > here is what I have inserted after and outside the [lineitems][/lineitems] > > > Quantity Discount! > $[format .2f][subtotal]-[discount][/format] > > > in formulas.db I have a line: > nameformula > > discount[lookup db=discount.db&lookInField=[quant]&value=[header40]&returnField=realprices¬Found=0] > > and a sample of discount.db looks like this > > quant listprice level discamnt realprices > 15959059 > 2 118 59 0 118 > 3 177 46.33 38.01 138.99 > 4 236 46.33 50.68 185.32 > and many many more.... > > where discamnt is the value i want subtracted from the subtotal. > > I get 0 always....in Quantity Discount! > > TIA > > Charley Conquest > Fresh Music > > ------------------------------------------------------------- > 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 Peacock

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:

Has this happened to you? (was:Emailer Chokes on bad address) (1997) .eml files (2001) [returnraw] and form variables (1998) Design Help Needed (1998) [OT] Site test... (2003) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) [shownext] and descending order (1997) international time (1997) Pull down menu for categories (2000) Verisigns SDK (pay flo pro) (2002) Browser based content... (2004) RAM variables (1997) Orderfile Encryption (2007) expired beta (1997) [OT] Internet Access (2003) [WebDNA] Conditional search (2009) taxTotal (1997) show if date < expiry date (2002) showcart problem, HELP! (1999) blank page from template (1997)