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:

Re:Running 2 two WebCatalog.acgi's (1996) Problem 2: Prefs file... (1997) Email Newsletters (2003) [WebDNA] Ubuntu 18.04 & Apache2 & WebDNA fcgi - File upload error (2019) [WebDNA] filter out the exclaimation point (2017) [WebDNA] macOS 10.13.3 and WebDNA Mac Server 8.5.1 - hick-up (2019) FORMS!! (2001) WebCat2b13MacPlugIn - [include] (1997) Plugin or CGI or both (1997) WebCat2 - Getting to the browser's username/password data (1997) Submitting ampersands in forms... (1998) Cookies and webcat (1997) WebCat2: multiple currency support (1997) [sendmail] v. [writefile] (2000) survey builder code (2003) Shopping Cart Problem (1998) Navigator 4.0 & tables (1997) dynamic list of form variables (2003) [input] context (1999) Emailer not working (1998)