Re: Looking up two prices in database?

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12592
interpreted = N
texte = Grant,>You may need to change the [saleprice] tag in your formula to [lookup >>db=products.db&lookInField=SKU&value=[SKU]&returnField=saleprice]Tried that! No difference.Is my basic formula correct, that is, am I going at it the right way with:price[math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]To me the logic of this formula is this:1. I'm actually not sure why I am using the [math] context. I'm really using two conditional statements to look for the price I want. COMMENT?2. The [showif] context defines the first condition. Check to see if the onsale field has a value of T. If it does, THEN show the value of the saleprice field as instructed by the [saleprice] tag.3. If the condition is met, I would expect the formula to show the sale price in the cell where I have any [price] tag.If it isn't met, I would expect the lookup to be performed and the regular price to be displayed wherever there is a [price] tag.That brings up the next question, which is, does WebCatalog move to the [lookup] or does it stop after the [showif]?I also thought of this formula, but it doesn't seem to work either.price[math][showif [onsale]=T][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=saleprice][/showif][ /math]Once again, the search is very straightfoward:Click here to see our in-house specials.The results.tmpl looks like this:[foundItems] [sku] [media] [Title] [Artist] [format .2f][price][/format] Add to cart [/foundItems]Jerry Associated Messages, from the most recent to the oldest:

    
  1. Re: Looking up two prices in database? (Grant Hulbert 1997)
  2. Re: Looking up two prices in database? ( 1997)
  3. Re: Looking up two prices in database? (Grant Hulbert 1997)
  4. Re: Looking up two prices in database? ( 1997)
  5. Re: Looking up two prices in database? (Grant Hulbert 1997)
  6. Looking up two prices in database? ( 1997)
Grant,>You may need to change the [saleprice] tag in your formula to [lookup >>db=products.db&lookInField=SKU&value=[SKU]&returnField=saleprice]Tried that! No difference.Is my basic formula correct, that is, am I going at it the right way with:price[math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]To me the logic of this formula is this:1. I'm actually not sure why I am using the [math] context. I'm really using two conditional statements to look for the price I want. COMMENT?2. The [showif] context defines the first condition. Check to see if the onsale field has a value of T. If it does, THEN show the value of the saleprice field as instructed by the [saleprice] tag.3. If the condition is met, I would expect the formula to show the sale price in the cell where I have any [price] tag.If it isn't met, I would expect the lookup to be performed and the regular price to be displayed wherever there is a [price] tag.That brings up the next question, which is, does WebCatalog move to the [lookup] or does it stop after the [showif]?I also thought of this formula, but it doesn't seem to work either.price[math][showif [onsale]=T][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=saleprice][/showif][ /math]Once again, the search is very straightfoward:Click [cart]&eqonsaledata =T>here to see our in-house specials.The results.tmpl looks like this:[founditems] [sku] [media] [Title] [Artist] [format .2f][price][/format] [url][SKU][/url]&cart=[car t]>Add to cart [/foundItems]Jerry

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:

Checkbox question (1997) tricky embedded[showifs/hideifs] (w/ code.. long) (2000) Restart of DBserver (1997) when is failing to [URL]ize values in a comparison risky? (1999) a little OT (2001) WebCatalog complains that the service is not running. (1998) pulling URL information (2003) Date search bug (1997) Dismissing dialogs (was 2.1b3 --> way slow) (1997) WCf2 and nested tags (1997) Multiple catalog databases and showcart (1997) Formating found categories (1997) one item in several different categories? (2000) [/application] error? (1997) NT version and O'reily's WebSite (1997) Can't Update records (1997) PayPal Instant Payment Notification (IPN) (2002) WebCat, The Trend, & Consolidating... (1997) [WebDNA] Yet another call for hosts... (2009) Spiders (1998)