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 Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: How far do [showif]s go? (Grant Hulbert 1997)
  2. Re: How far do [showif]s go? (Kenneth Grome 1997)
  3. How far do [showif]s go? (Kevin Furuta 1997)
>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 Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/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:

Country & Ship-to address & other fields ? (1997) Multiple Ad databases? (1997) Multiple prices (1997) Multiple security dbs (1997) Support ?? (1997) [WebDNA] Dynamic vertical columns (2008) Re:[off] Promotions Co? (1997) Frames (1997) WebCat2 beta 11 - new prefs ... (1997) Letters as SKU (1998) WebCat2 several catalogs? (1997) Setting up shop (1997) default value from Lookup (was Grant, please help me) (1997) Sort Order on a page search (1997) [WebDNA] how to make webroot the start of path (2017) Extended [ConvertChars] (1997) form validator issue (2005) form data submission gets truncated (1997) Webcatalog, Webstar and Crasharama (1999) PIXO (1997)