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:

CMS - Formatting Content (2004) [WebDNA] [thisautonumber] and [lastautonumber] (2011) ShipTo Countries (2006) form data submission gets truncated (1997) CGI and SSI (2002) WebCatalog 4.0.2b5 available (2000) HTML Editors (1997) I forgot (1998) [WebDNA] TCPConnect Problem (2010) F*** you (1998) RAM variables (1997) [Sum] function? (1997) Search design (1997) Monthly Reports (2000) For those of you not on the WebCatalog Beta... (1997) Cobalt RaQ Installation (2003) Webmerchant orders? (2000) [WebDNA] sem_open bugfix for os x version 6.2 (2012) WebCat2b12--[searchstring] bug (1997) [createfolder] & [deletefolder] (1997)