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:

GrandTotal not right (1997) Search a date field by month only... (1999) webcat2b12 CGI -- Date comparisons (1997) Group search doesn't work. (1997) Summing fields (1997) WebCatalog Eating 200% of the CPU (2002) Re[2]: 2nd WebCatalog2 Feature Request (1996) Using Plug-In while running 1.6.1 (1997) Download capabilities (1997) WebCatalog for Dummies p.1 (2000) setheader and retrieve it immediatly (2001) Emailer setup (1997) can you reassign loop index? (1998) Changing price for a SLU based on options (size, etc.) (1997) [Webcat 2]Next (1997) Universal root for WC errors? (1997) Frames and WebCat (1997) PCS Frames (1997) Setting up the server (1997) using listfiles to build a database? (2000)