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:
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]&eqonsaledata=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:
Further on formula.db failure to calculate shipCost (1997)
WebSTAR/WebCat is serving .db files! (1999)
[OT] iFrame (body) Q (2004)
Custom Shipping Charges (1997)
buy 2 items get this free (2003)
F3 crashing server (1997)
(1997)
Country & Ship-to address & other fields ? (1997)
[SearchString] usage (1997)
Bug Report, maybe (1997)
[Sum] function? (1997)
Showing unopened cart (1997)
WebCatalog and directory indexing (1998)
New command suggestion (was Modifying databases manually) (1997)
Re[2]: Enhancement Request for WebCatalog-NT (1996)
Re:WebCatalog f2 Installation (1997)
Extended [ConvertChars] (1997)
WebCatalog 2.0 & WebDNA docs in HTML ... (1997)
blank page from template (1997)
creating a 60 fields database (1997)