Re: [SMSI]Re: Price and Formula.db

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 45583
interpreted = N
texte = Thanks, Donovan. Your suggested changes have been made.> -----Original Message----- > From: WebCatalog Talk > [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf > Of Donovan > Sent: Wednesday, November 20, 2002 8:10 AM > To: WebCatalog Talk > Subject: [SMSI]Re: Price and Formula.db > > > John, > Thanks for the response. > I believe the answer is yes (as I think you stated). I > created a test store to > play around to look at the formulas.db. > Here is the untouched formula from the test store (all one > line of course). > > Name Formula > price [text show=f&multi=t]foundOverride=F&actualPrice=[lookup > db=admin/products.db&lookInField=sku&value=[sku]&returnField=p > rice][/text][formvariables > name=__&exact=f][search > db=admin/related.db&eqR_IDdatarq=[value]&eqR_CATEGORYdatarq=[getchars > start=3][name][/getchars]][founditems][ShowIf ![r_ovr_price]][text > show=f&multi=t]foundOverride=T&actualPrice=[r_ovr_price][/text > ][/ShowIf][/founditems][/search][/formvariables][actualPrice] > > There would be no reason for the formvariables loop if form > vars couldn't be > passed in. > > From the FILE FORMATS on-line docs: > > but you can still customize pricing by creating a formula to > calculate a different > price based on any > WebDNA tags, such as [username], [zip], or even a [math] calculation. > > > ****SCOTT****, (when you get a moment ;-) can you change the above to: > > but you can still customize pricing by creating a formula to > calculate a different > price based on any > WebDNA tags, such as [username], [zip], [math] calculation, > or any form, text or > math variable that is active on that page. > > AND can you change: > > 2.If Formulas.db contains a price formula, then evaluate > the WebDNA expression > (in the context of the current lineitem, so tags such as > [price], [quantity], [zip] and [sku] are available). > > to > > 2.If Formulas.db contains a price formula, then evaluate > the WebDNA expression > (in the context of the current lineitem, so tags such as > [price], [quantity], [zip] and [sku] are available as > well as any form, text > or math variables active on that page). > > > You could also state clearer that Since the formulas.db is a > database there must > be no carraige returns other than signifing line endings in > the formula. > a way around this could be using comments ([!][/!]) to hide > extra carraige > returns. ie: > > --formula.inc-- > ___________ > [if [username]=SCOTT][!] > [/!][then][math][_discount]*[lookup > db=products.db&lookInField=sku&value=[sku]&returnField=price][ > /math][/then][!] > [/!][else][lookup > db=products.db&lookInField=sku&value=[sku]&returnField=price][ > /else][/if]. > > This is something we all learn but it is learned from the > archives or the list and > not the docs. > > A quick search in the archives will show a record of the > confussion the formulas.db > has caused > over the years. I remeber dealing with it a year and a half ago. > > Thanks, > Donovan > > > > John Peacock wrote: > > > Donovan wrote: > > > Can a variable be passed into a formulas.db other than the > > > orderfile/lineitems and internal webcat > > > variables? > > > > > > > How would you expect to pass in a variable to the > formulas? If you are using > > the '?add' command and including an additional URL > parameter, then the answer > > is, I believe, no. Using a [addlineitem] context is much > more likely to give > > you the control you need. > > > > Formulas.db is only used (currently) when adding an item to > the cart. As such, > > it automatically gains access to the current orderfile > header fields, any and > > all fields from the database that is included as part of the add > > command/context, all builtin webcat contexts, and AFAIK any > and all active form > > variables at that point on the page. > > > > To confirm this, add something like this to the price line > in your formulas.db: > > > > [WriteFile > SomeTextFile][FormVariables][index],[name],[value]
> > [/FormVariables][/WriteFile] > > > > (obviously all as a single line). This will show you > exactly what is available > > for you to use within the formulas.db. > > > > HTH > > > > John > > > > > > -- > > -------------------------------------------------------------- > ---------- > > > -------------------------------------------------------------- > ---------- > > <><> Donovan Brooke <><>->ï > > -------------------------------------------------------------- > ---------- > > > -------------------------------------------------------------- > ---------- > > > ------------------------------------------------------------- > 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:

    
Thanks, Donovan. Your suggested changes have been made.> -----Original Message----- > From: WebCatalog Talk > [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf > Of Donovan > Sent: Wednesday, November 20, 2002 8:10 AM > To: WebCatalog Talk > Subject: [SMSI]Re: Price and Formula.db > > > John, > Thanks for the response. > I believe the answer is yes (as I think you stated). I > created a test store to > play around to look at the formulas.db. > Here is the untouched formula from the test store (all one > line of course). > > Name Formula > price [text show=f&multi=t]foundOverride=F&actualPrice=[lookup > db=admin/products.db&lookInField=sku&value=[sku]&returnField=p > rice][/text][formvariables > name=__&exact=f][search > db=admin/related.db&eqR_IDdatarq=[value]&eqR_CATEGORYdatarq=[getchars > start=3][name][/getchars]][founditems][ShowIf ![r_ovr_price]][text > show=f&multi=t]foundOverride=T&actualPrice=[r_ovr_price][/text > ][/ShowIf][/founditems][/search][/formvariables][actualPrice] > > There would be no reason for the formvariables loop if form > vars couldn't be > passed in. > > From the FILE FORMATS on-line docs: > > but you can still customize pricing by creating a formula to > calculate a different > price based on any > WebDNA tags, such as [username], [zip], or even a [math] calculation. > > > ****SCOTT****, (when you get a moment ;-) can you change the above to: > > but you can still customize pricing by creating a formula to > calculate a different > price based on any > WebDNA tags, such as [username], [zip], [math] calculation, > or any form, text or > math variable that is active on that page. > > AND can you change: > > 2.If formulas.db contains a price formula, then evaluate > the WebDNA expression > (in the context of the current lineitem, so tags such as > [price], [quantity], [zip] and [sku] are available). > > to > > 2.If formulas.db contains a price formula, then evaluate > the WebDNA expression > (in the context of the current lineitem, so tags such as > [price], [quantity], [zip] and [sku] are available as > well as any form, text > or math variables active on that page). > > > You could also state clearer that Since the formulas.db is a > database there must > be no carraige returns other than signifing line endings in > the formula. > a way around this could be using comments ([!][/!]) to hide > extra carraige > returns. ie: > > --formula.inc-- > ___________ > [if [username]=SCOTT][!] > [/!][then][math][_discount]*[lookup > db=products.db&lookInField=sku&value=[sku]&returnField=price][ > /math][/then][!] > [/!][else][lookup > db=products.db&lookInField=sku&value=[sku]&returnField=price][ > /else][/if]. > > This is something we all learn but it is learned from the > archives or the list and > not the docs. > > A quick search in the archives will show a record of the > confussion the formulas.db > has caused > over the years. I remeber dealing with it a year and a half ago. > > Thanks, > Donovan > > > > John Peacock wrote: > > > Donovan wrote: > > > Can a variable be passed into a formulas.db other than the > > > orderfile/lineitems and internal webcat > > > variables? > > > > > > > How would you expect to pass in a variable to the > formulas? If you are using > > the '?add' command and including an additional URL > parameter, then the answer > > is, I believe, no. Using a [addlineitem] context is much > more likely to give > > you the control you need. > > > > formulas.db is only used (currently) when adding an item to > the cart. As such, > > it automatically gains access to the current orderfile > header fields, any and > > all fields from the database that is included as part of the add > > command/context, all builtin webcat contexts, and AFAIK any > and all active form > > variables at that point on the page. > > > > To confirm this, add something like this to the price line > in your formulas.db: > > > > [WriteFile > SomeTextFile][formvariables][index],[name],[value]
> > [/FormVariables][/WriteFile] > > > > (obviously all as a single line). This will show you > exactly what is available > > for you to use within the formulas.db. > > > > HTH > > > > John > > > > > > -- > > -------------------------------------------------------------- > ---------- > > > -------------------------------------------------------------- > ---------- > > <><> Donovan Brooke <><>->ï > > -------------------------------------------------------------- > ---------- > > > -------------------------------------------------------------- > ---------- > > > ------------------------------------------------------------- > 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/ Scott Anderson

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:

ShowNext truncating passed variable?? (1997) WebCat2b15MacPlugin - showing [math] (1997) [WebDNA] Mail not sending (2018) why is authenticate screwing with me today (2002) Help! WebCat2 bug (1997) serial number (1998) WebCatalog can't find database (1997) using showpage and showcart commands (1996) emailer (1997) RE: Formulas.db + Users.db (1997) Problems getting parameters passed into email. (1997) [ShowIf] if the varieable exists (1998) purchase plugin (1996) getchars broken? (1997) webDNA and ASP pages (1997) Pithy questions on webcommerce & siteedit (1997) Banner Ad Server Solutions Using WEbDNA (2000) problems with 2 tags (1997) email code (1998) PCS Frames (1997)