Looking up two prices in database?

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12573
interpreted = N
texte = Hello All,I need some help looking up two prices in my database.This is the situation. My customer sells his products either at full price, or at a sale price. Both prices are in the database which contains nearly 15,000 records. ( Imention this because using multiple databases to solve this problem is probably not an option.) There is also a field onsale which is set to either T or F. What I had thought to do was look in the database to check if a product was on sale (onsale=T0 and set the price accordingly.I have tried a modification of a formula that is in the online docs.price [math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]I have two search methods.To search for the onsale items is am using a hypertext link like thisClick here to see our in-house specials.It successfully returns the items where onsale=T and displays the price of the first item as 2.73 which is its regular price and a price of 5.00 for the second item the price of which is actually 5.33.The second search is triggered from a form and finds items by the product, category, price, etc.. It finds all the products searched for successfully, including those where onsale=T. Here's the wierd part. The prices of the two items for which onsale=T are displayed as 2.73 and 5.33, the correct prices from the database.The results pages for the two searches are IDENTICAL. I simply did a save as to create the SaleResults.tmpl template as a duplicate of the Results.tmpl template.Therefore, I have two questions.1. How do I get WebCatalog to look up and display the saleprice when onsale=T and the regular price when onsale=F? OR is there a better way to do this.2. Why does WebCatalog display the prices differently in identical results.tmpl templates?This is the last hurdle I must overcome to get this site up live. Everything else is working just as I had hoped.Thanks for any help you can provide.Jerry Nielsen - commSTRUCT Associates 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)
Hello All,I need some help looking up two prices in my database.This is the situation. My customer sells his products either at full price, or at a sale price. Both prices are in the database which contains nearly 15,000 records. ( Imention this because using multiple databases to solve this problem is probably not an option.) There is also a field onsale which is set to either T or F. What I had thought to do was look in the database to check if a product was on sale (onsale=T0 and set the price accordingly.I have tried a modification of a formula that is in the online docs.price [math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]I have two search methods.To search for the onsale items is am using a hypertext link like thisClick [cart]&eqonsaledat a=T>here to see our in-house specials.It successfully returns the items where onsale=T and displays the price of the first item as 2.73 which is its regular price and a price of 5.00 for the second item the price of which is actually 5.33.The second search is triggered from a form and finds items by the product, category, price, etc.. It finds all the products searched for successfully, including those where onsale=T. Here's the wierd part. The prices of the two items for which onsale=T are displayed as 2.73 and 5.33, the correct prices from the database.The results pages for the two searches are IDENTICAL. I simply did a save as to create the SaleResults.tmpl template as a duplicate of the Results.tmpl template.Therefore, I have two questions.1. How do I get WebCatalog to look up and display the saleprice when onsale=T and the regular price when onsale=F? OR is there a better way to do this.2. Why does WebCatalog display the prices differently in identical results.tmpl templates?This is the last hurdle I must overcome to get this site up live. Everything else is working just as I had hoped.Thanks for any help you can provide.Jerry Nielsen - commSTRUCT Associates

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:

WebCatalog/Mac 2.1b2 New Features (1997) Is this possible in simple search? question? (1998) Cart Unique After Rolling Back Time? (2001) Encrypting WebDNA Templates (1999) Previous and Next Solution (2004) WCS Newbie question (1997) your mail (2000) convertWords... NEW (2001) More on the email templates (1997) [WebDNA] WebDNA Server build instructions (2019) xml - amazon bug and sed q: (2004) Adding Fields To Db from DB Helper (1999) [WriteFile] problems (1997) Claris HomePage messes up the code (1997) RE: type 2 errors with ssl server (1997) WebCatalog can't find database (1997) Not really WebCat (1997) Paranoid about serial numbers...not (1998) Line items in table cells (1997) denied access (1997)