Custom formulas.db

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 21838
interpreted = N
texte = CourierHi all Is it possible to use formulas.db to compute values other than price, unitshipcost,taxrate etc... and have your own formulas in there. For instance in this project I have ship costs based on weight, and subtotal (the subtotal of the items that aren't weight based). I calculate the total weight and total non-weight subtotal with this snippet from shopingcart.tpl.... << This works, so now I want to get values for the weight ship total and the Price ship total. I would like to be able to drop [weightshiptotal] and [priceshiptotal] onto invoice.tpl. So I figured I could just write this into formulas.db[priceshiptotal]`tab'[showif [priceship]<<101][search db=sub100a.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100][search db=100plus.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif]and also this... [weightshiptotal]~tab [search db=weight.db&wostatedatarq=[shiptostate]&leweightdatarq=[weightshiptotal]&weightsort=1&weightsdir=de&weighttype=num&max=1][founditems][cost][/founditems][/search] No joy though, however if I change [priceshiptotal] in formulas.db to shipCost it works fine ie...shipCost [showif [priceship]<<101][search db=sub100a.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100][search db=100plus.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100] The only problem is I need both the priceshiptotal and the weightshiptotal so I can display them and so I can make grandTotal [math][grandtotal]+weightshiptotal]+[priceshiptotal][/math] Should these custom formulas be working in Version 2.1 and I should just scour the code for a little mistake, or is formulas.db not designed to do this and I should look for another way. Help is appreciated Tim Associated Messages, from the most recent to the oldest:

    
  1. Re: Custom formulas.db (PCS Technical Support 1998)
  2. Re: Custom formulas.db (Tim Taylor 1998)
  3. Re: Custom formulas.db (PCS Technical Support 1998)
  4. Re: Custom formulas.db (Kenneth Grome 1998)
  5. Re: Custom formulas.db (Tim Taylor 1998)
  6. Re: Custom formulas.db (Grant Hulbert 1998)
  7. Re: Custom formulas.db (Kenneth Grome 1998)
  8. Re: Custom formulas.db (PCS Technical Support 1998)
  9. Re: Custom formulas.db (Kenneth Grome 1998)
  10. Re: Custom formulas.db (PCS Technical Support 1998)
  11. Custom formulas.db (Tim Taylor 1998)
CourierHi all Is it possible to use formulas.db to compute values other than price, unitshipcost,taxrate etc... and have your own formulas in there. For instance in this project I have ship costs based on weight, and subtotal (the subtotal of the items that aren't weight based). I calculate the total weight and total non-weight subtotal with this snippet from shopingcart.tpl.... <[math][lineitems]([weight]*[quantity])+[/lineitems]0[/math]><[math][lineitems][hideif [weight]!]([price]*[quantity])+[/hideif][/lineitems]0[/math]> This works, so now I want to get values for the weight ship total and the Price ship total. I would like to be able to drop [weightshiptotal] and [priceshiptotal] onto invoice.tpl. So I figured I could just write this into formulas.db[priceshiptotal]`tab'[showif [priceship]<<101][search db=sub100a.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100][search db=100plus.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif]and also this... [weightshiptotal]~tab [search db=weight.db&wostatedatarq=[shiptostate]&leweightdatarq=[weightshiptotal]&weightsort=1&weightsdir=de&weighttype=num&max=1][founditems][cost][/founditems][/search] No joy though, however if I change [priceshiptotal] in formulas.db to shipCost it works fine ie...shipCost [showif [priceship]<<101][search db=sub100a.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100][search db=100plus.db&wostatedatarq=[shiptostate]&lesubdatarq=[shipsub]&subsdir=ds&subsort=1&subtype=num&max=1][founditems][cost][/founditems][/search][/showif] [showif [priceship]>100] The only problem is I need both the priceshiptotal and the weightshiptotal so I can display them and so I can make grandTotal [math][grandtotal]+weightshiptotal]+[priceshiptotal][/math] Should these custom formulas be working in Version 2.1 and I should just scour the code for a little mistake, or is formulas.db not designed to do this and I should look for another way. Help is appreciated Tim Tim Taylor

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:

Navigator Parsing (1997) Secure Sever and showcart errors (1997) 2nd WebCatalog2 Feature Request (1996) Shipping Calc - done (1998) Cancel Subscription (1996) New York City sales tax database needed (1997) Removing a character (2000) Make sure I understand this??? (1997) Bug Report, maybe (1997) sorting dates (1999) Now you see it now you donīt (1997) oops private message leaked into talk list (1997) Newbie questions (1999) [OT] Appropriate Signature??? (2003) Bug Report, maybe (1997) converted seed value? (1998) sql context issues (2001) splitting numbers in webDNA? (1997) form data submission gets truncated (1997) Possible Hijacking from Globix (2002)