Re: Frustration with formulas.db

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 25487
interpreted = N
texte = The hideif statement is just there to cancel out your shipping if they have no items in the cart. You said there was an initial charge of like $4 for the first item, but if you have a view cart button on your site which allows users to see the cart vefore adding anything to it, they will see a charge for $4 and they didnt buy anything yet. The hideif statement adds up every item in the cart and if it is 0, then the initial charge is not added in. It is not necessary, just looks more professional. The lneitems is used in the math tags to count up every product bought. [lineitems is almost like the way a founditems works, but for the cart.,, so [math]0[lineitems]+[quantity][/lineitems][/math] takes the found items quantities and adds them to the initial zero i have in there. So when used in a hideif, if no quanitities are found, the zero is still there to complete the hideif function of [hideif 0=0] Hope this clears it up for you.Brian Boegershausen WebCatalog Programmer www.orderbywire.com ----- Original Message ----- From: Kevin Lippert To: WebCatalog Talk Sent: Wednesday, December 15, 1999 1:16 AM Subject: Re: Frustration with formulas.db > Brian and Kenneth, > > Thanks for the pointers. The Shipcost modification appears to work. Can > you explain the [hideif 0=[math]0[lineitems] syntax, something I've seen > in several places. I assume the whole calculation is hidden if the result > is 0 ([hideif 0=0]) but what does 0[lineitems] do? Is this interpreted as > 01 for the first lineitem, 02 for the second, etc.? > > I'm still have problems with the sales tax. Maybe I don't understand the > point of [interpret]. In the example I posted below, am I supposed to put > [interpret][taxRate][/interpret] > in my .tpl file? This doesn't seem to work; the tax always comes back as > 0.00. However, if I embed the [lookup] directly in my .tpl page, it > returns the proper percentage. > > Thanks for your valuable advice, > > Kevin Lippert > > > On 12/14/99 2:06 AM, you wrote: > > >For the tax problem, make sure you have a field in the database named > >taxable with each product set to true or the tax will not work. > >As for your shipping, you need to fix your formula a bit. > >You formula: > >Shiptype [math]2.00+([lineitems](1*[quantity])[/lineitems])[/math] > >should be called shipcost, and is not going to calculate correctly because > >you need to make it show everyline item qualtity. > >Try: > >Shipcost [hideif > >0=[math]0[lineitems]+[quantity][/lineitems][/math]][math]2.00+(2.00*(0[line i > >tems]+[quantity][/lineitems]))[/math][/hideif] > >This will add all the quantities up for you and also zero out the shipping > >cost if they check out the shoppingcart page before any items have been > >added. > > > >Brian Boegershausen > >WebCatalog Programmer > >www.orderbywire.com > >----- Original Message ----- > >From: Kevin Lippert > >To: WebCatalog Talk > >Sent: Tuesday, December 14, 1999 12:24 AM > >Subject: Frustration with formulas.db > > > > > >> I'd like the taxRate to lookup on [State] if [ShipToState] is blank (so > >> people don't have to enter a ShipToState seperately). My first thought is > >> that this is easiest to do in formulas.db, something like: > >> > >> taxRate [interpret][lookup db=TaxRates.db&lookInField=State&value=[showif > >> [ShipToState]>][ShipToState][/showif][showif > >> > >[ShipToState]=][State][/showif]&returnField=taxRate¬Found=0.00][/inter > >> pret] > >> > >> which seems to return the proper tax rate based on the value in [State], > >> but the builtin [taxTotal] value always returns 0.00. Does this come > >> from someplace else than [taxRate]*[taxableTotal]? > >> > >> A second, maybe related question, concerns ShipCosts.db. We want to > >> charge $4 for the first item, and $2 for each item thereafter. Again, I > >> thought it easiest to use this formula in ShipCosts.db: > >> > >> Shiptype [math]2.00+([lineitems](1*[quantity])[/lineitems])[/math] > >> > >> the logic here being $2.00 plus ($2 * the number of items), but this > >> doesn't seem to work, either (even wrapped in [interpret]) > >> > >> Can I not use formulas like [math] and [showif] in lookups like these? > >> > >> Thanks in advance, > >> > >> Kevin Lippert > >> > > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > 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 ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Associated Messages, from the most recent to the oldest:

    
  1. Re: Frustration with formulas.db (Brian Boegershausen 1999)
  2. Re: Frustration with formulas.db (Kevin Lippert 1999)
  3. Re: Frustration with formulas.db (Brian Boegershausen 1999)
  4. Re: Frustration with formulas.db (Brian Boegershausen 1999)
  5. Re: Frustration with formulas.db (Kenneth Grome 1999)
  6. Frustration with formulas.db (Kevin Lippert 1999)
The hideif statement is just there to cancel out your shipping if they have no items in the cart. You said there was an initial charge of like $4 for the first item, but if you have a view cart button on your site which allows users to see the cart vefore adding anything to it, they will see a charge for $4 and they didnt buy anything yet. The hideif statement adds up every item in the cart and if it is 0, then the initial charge is not added in. It is not necessary, just looks more professional. The lneitems is used in the math tags to count up every product bought. [lineitems is almost like the way a founditems works, but for the cart.,, so [math]0[lineitems]+[quantity][/lineitems][/math] takes the found items quantities and adds them to the initial zero i have in there. So when used in a hideif, if no quanitities are found, the zero is still there to complete the hideif function of [hideif 0=0] Hope this clears it up for you.Brian Boegershausen WebCatalog Programmer www.orderbywire.com ----- Original Message ----- From: Kevin Lippert To: WebCatalog Talk Sent: Wednesday, December 15, 1999 1:16 AM Subject: Re: Frustration with formulas.db > Brian and Kenneth, > > Thanks for the pointers. The Shipcost modification appears to work. Can > you explain the [hideif 0=[math]0[lineitems] syntax, something I've seen > in several places. I assume the whole calculation is hidden if the result > is 0 ([hideif 0=0]) but what does 0[lineitems] do? Is this interpreted as > 01 for the first lineitem, 02 for the second, etc.? > > I'm still have problems with the sales tax. Maybe I don't understand the > point of [interpret]. In the example I posted below, am I supposed to put > [interpret][taxRate][/interpret] > in my .tpl file? This doesn't seem to work; the tax always comes back as > 0.00. However, if I embed the [lookup] directly in my .tpl page, it > returns the proper percentage. > > Thanks for your valuable advice, > > Kevin Lippert > > > On 12/14/99 2:06 AM, you wrote: > > >For the tax problem, make sure you have a field in the database named > >taxable with each product set to true or the tax will not work. > >As for your shipping, you need to fix your formula a bit. > >You formula: > >Shiptype [math]2.00+([lineitems](1*[quantity])[/lineitems])[/math] > >should be called shipcost, and is not going to calculate correctly because > >you need to make it show everyline item qualtity. > >Try: > >Shipcost [hideif > >0=[math]0[lineitems]+[quantity][/lineitems][/math]][math]2.00+(2.00*(0[line i > >tems]+[quantity][/lineitems]))[/math][/hideif] > >This will add all the quantities up for you and also zero out the shipping > >cost if they check out the shoppingcart page before any items have been > >added. > > > >Brian Boegershausen > >WebCatalog Programmer > >www.orderbywire.com > >----- Original Message ----- > >From: Kevin Lippert > >To: WebCatalog Talk > >Sent: Tuesday, December 14, 1999 12:24 AM > >Subject: Frustration with formulas.db > > > > > >> I'd like the taxRate to lookup on [State] if [ShipToState] is blank (so > >> people don't have to enter a ShipToState seperately). My first thought is > >> that this is easiest to do in formulas.db, something like: > >> > >> taxRate [interpret][lookup db=TaxRates.db&lookInField=State&value=[showif > >> [ShipToState]>][ShipToState][/showif][showif > >> > >[ShipToState]=][State][/showif]&returnField=taxRate¬Found=0.00][/inter > >> pret] > >> > >> which seems to return the proper tax rate based on the value in [State], > >> but the builtin [taxTotal] value always returns 0.00. Does this come > >> from someplace else than [taxRate]*[taxableTotal]? > >> > >> A second, maybe related question, concerns ShipCosts.db. We want to > >> charge $4 for the first item, and $2 for each item thereafter. Again, I > >> thought it easiest to use this formula in ShipCosts.db: > >> > >> Shiptype [math]2.00+([lineitems](1*[quantity])[/lineitems])[/math] > >> > >> the logic here being $2.00 plus ($2 * the number of items), but this > >> doesn't seem to work, either (even wrapped in [interpret]) > >> > >> Can I not use formulas like [math] and [showif] in lookups like these? > >> > >> Thanks in advance, > >> > >> Kevin Lippert > >> > > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > 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 ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Brian Boegershausen

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:

same products but different (1998) Why is my easy [AddLineItems] NOT working?? MORE (2000) DON'T use old cart file! (1997) Getting URL's entered manually (1997) Format question WC Mac f3 (1997) Counting LineItems (2000) AuthorizeNet SSL Update (2004) [WebDNA] Hard-coded db write delay when running certain code? (2011) Autonumber in Table (2006) [math] with first letter in field? (1997) Two prices in shoppingcart? (1997) Time Display from Database (1997) Setting up shop (1997) WebCatalog can't find database (1997) Database Structure? (1998) New index for docs (1997) ListFiles and .DS_Store (2004) RE: Can't get appendfile to work (1997) RE: Formulas.db + Users.db (1997) [WriteFile] problems (1997)