Re: Formulas.db
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 40322
interpreted = N
texte = Donovan Brooke wrote:> Hello again,> Anyone ready to delve into the depths of Price Formulas?> > this might the first of perhaps a few questions regarding Formulas.db...(another item I think is> under covered in the docs...no offence, grant, jay, john and Scott :-) I will have a few complex discounts going on.> Here is my first question that I can't find the answer to. (btw, I'll try to keep the questions in this same thread)> > Can a variable be passed from the formulas.db to the page that will get the price?No. Any line in the formulas.db is used strictly to return a single value (it is like a [lookup] in that way) which is used to set a specific field in the cart.> > Here is the beginnings of one of my discounts (un verified). It is a discount that is given if the product is in a certain> category And, if it is a certain time of the year. The year part I haven't implimented yet.> > [showif [url][lookup db=products.db&lookInField=sku&value=[sku]&returnField=CATEGORY][/url]=TFP Tax> Forms][text]subprice=[math][lookup> db=products.db&lookInField=sku&value=[sku]&returnField=PRICE][/text][text]disc=[math][subprice]*.1[/math][/text][math][subprice]-[dis][/math][/showif]Always debug your formulas in a standard template; You will find out more by breaking down the formula into bite size pieces on a page you can see. Once you have the value you want, combine the lines on the page into a single line which you can put into the formulas.db.NOTE: the use of quotes in [showif] is unnecessary. In [if] statements, the quotes force the terms to be compared as strings.> > This is more than one line in this email but it is only one line in my db of course. My problem is that I need to come> up with a different strategy if I am going to incorporate all my discounts. (the one line would very long) How are people doing> this?> > Can I use [include file=] within a .db value?If you mean inside a formulas.db entry, yes, I think people have had success (remember that it must still be on one line).John-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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:
Donovan Brooke wrote:> Hello again,> Anyone ready to delve into the depths of Price Formulas?> > this might the first of perhaps a few questions regarding formulas.db...(another item I think is> under covered in the docs...no offence, grant, jay, john and Scott :-) I will have a few complex discounts going on.> Here is my first question that I can't find the answer to. (btw, I'll try to keep the questions in this same thread)> > Can a variable be passed from the formulas.db to the page that will get the price?No. Any line in the formulas.db is used strictly to return a single value (it is like a [lookup] in that way) which is used to set a specific field in the cart.> > Here is the beginnings of one of my discounts (un verified). It is a discount that is given if the product is in a certain> category And, if it is a certain time of the year. The year part I haven't implimented yet.> > [showif [url][lookup db=products.db&lookInField=sku&value=[sku]&returnField=CATEGORY][/url]=TFP Tax> Forms][text]subprice=[math][lookup> db=products.db&lookInField=sku&value=[sku]&returnField=PRICE][/text][text]disc=[math][subprice]*.1[/math][/text][math][subprice]-[dis][/math][/showif]Always debug your formulas in a standard template; You will find out more by breaking down the formula into bite size pieces on a page you can see. Once you have the value you want, combine the lines on the page into a single line which you can put into the formulas.db.NOTE: the use of quotes in [showif] is unnecessary. In [if] statements, the quotes force the terms to be compared as strings.> > This is more than one line in this email but it is only one line in my db of course. My problem is that I need to come> up with a different strategy if I am going to incorporate all my discounts. (the one line would very long) How are people doing> this?> > Can I use [include file=] within a .db value?If you mean inside a formulas.db entry, yes, I think people have had success (remember that it must still be on one line).John-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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/
John Peacock
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:
CAll me Crazy (2000)
Web Catalog 2 demo (1997)
shownext (1997)
WebCat B13 Mac CGI -- Frames question (1997)
Cancel Subscription (1996)
WC2b15 File Corruption (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
Unanswered trigger questions ... (2003)
rename a file (1997)
WC2b15 File Corruption (1997)
[URL] and [showif] or [hideif] comparisons (2003)
(1997)
Pull down menu for categories (2000)
YACBQ.....(Yet another checkbox question) (2000)
[WriteFile] problems (1997)
emailer settings and control questions (1997)
Help w/Multi User Admins (1997)
Keep away (1997)
Re:Help name our technology! (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)