Re: How far do [showif]s go?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 12794
interpreted = N
texte = >In the manual, [showif] can be used in the formula db. However, when I try>to do it inside of a db that is part of a [lookup] it doesn't seem to work.>Is there a limit only to the formula db or can I use them in sub db that>are [lookup]ed by the formula?You can use showif inside a formula, but just remember that there are limits to how ddeply you can 'nest' them.Also remember that formulas are evaluated in the context of the OrderFile, not in the context of a LineItem. In English, that means you can't make use of variables like [price], [taxable], [textA], [quantity], etc. You only have access to order file header variables like [email], [header1], [shipVia], etc. You *do* have access to [sku], because that's one of the variables you pass explicitly into the $Add command.If you want access to line item variables, you can pass them as extra values in the $Add URL, or you can do [lookup] in the body of the formula.I know this is a pain, so I'm going to try to figure out a nicer way to handle it in the future. My problem right now is that when you're $Add-ing to the cart, the lineitem you're *about* to add doesn't exist yet, so I can't give you those variables because there's no context for them yet. Maybe I'll 'fake up' a context in the future that holds all the lineitem information so it's easier to put into formulas.And remember, formulas were invented as a security measure: it would be very easy to just put the price right into the $Add URL when you're adding to the cart, but then it would be too easy for hackers to simply change the price to anything they want. So formulas were invented as a hack-proof way to change prices without outsiders being able to mess with them.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors =====Pacific Coast Software | WebCatalog Pro, WebCommerce Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com
Associated Messages, from the most recent to the oldest:
>In the manual,
[showif] can be used in the formula db. However, when I try>to do it inside of a db that is part of a
[lookup] it doesn't seem to work.>Is there a limit only to the formula db or can I use them in sub db that>are
[lookup]ed by the formula?You can use showif inside a formula, but just remember that there are limits to how ddeply you can 'nest' them.Also remember that formulas are evaluated in the context of the OrderFile, not in the context of a LineItem. In English, that means you can't make use of variables like [price], [taxable], [textA], [quantity], etc. You only have access to
order file header variables like [email], [header1], [shipVia], etc. You *do* have access to [sku], because that's one of the variables you pass explicitly into the $Add command.If you want access to line item variables, you can pass them as extra values in the $Add URL, or you can do
[lookup] in the body of the formula.I know this is a pain, so I'm going to try to figure out a nicer way to handle it in the future. My problem right now is that when you're $Add-ing to the cart, the lineitem you're *about* to add doesn't exist yet, so I can't give you those variables because there's no context for them yet. Maybe I'll 'fake up' a context in the future that holds all the lineitem information so it's easier to put into formulas.And remember, formulas were invented as a security measure: it would be very easy to just put the price right into the $Add URL when you're adding to the cart, but then it would be too easy for hackers to simply change the price to anything they want. So formulas were invented as a hack-proof way to change prices without outsiders being able to mess with them.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors =====Pacific Coast Software | WebCatalog Pro, WebCommerce Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com
Grant Hulbert
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:
Nav4 not specifying cart (1997)
Empty Shopping Carts? (1998)
Date Bug (1998)
Search inside Include (1998)
[WebDNA] total (2010)
PR: WebCatalog Affiliates Program Announced -- Share the revenuefor promoting WebCatalog (2000)
Adding multiple items to Cart at one time, & append contextproblem (1998)
[SHOWIF] (1997)
More on the email templates (1997)
For those of you not on the WebCatalog Beta... (1997)
Ignoring [OrderFile] context (2005)
Include Files (1998)
WebCatalog for guestbook ? (1997)
[WebDNA] Upgrade from OS 10.7.5 WebDNA 6.2 to Mavericks (2013)
WebCatalog Use Question (1997)
Limitations on fields? Server is crashing (1997)
Database Updates (1997)
[WebDNA] v7 Stress Test and Strange Behaviour (2012)
Math, Multiple Equasions and Show/Hide (1998)
Multiple prices (1997)