Re: Display [price] in banner ad
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 19785
interpreted = N
texte = >Thanks, this does work and displays the price. However, I also have a>markup of>the price and the markup works fine in the details.tpl but not with the>banner ad>and I can't seem to figure out what I need to change to get it to work.The reason is that just putting [price] into your banner ad is not enoughfor WebCatalog to know what the price should be. It needs to know whatdatabase to look in, what sku to look for, etc. That's why you use the[lookup] to find the price. So from a simplistic standpoint, if yousubstitute that big [lookup] everywhere you need [price] in your big mathequation, then you'd get the right information.There is a way to simplify this with an [include], though, so you don'thave to do so much typing:-- MarkupCalc.inc --(put that big bunch of [ShowIf] with [math] text here)Then anywhere you need the marked-up price (even on your details.tpl page), use[include file=MarkupPrice.inc&price=[Lookupdb=catalog.txt&lookinfield=sku&value=[sku]&returnfield=price]]You're basically making a 'macro' that takes a SKU and looks up itsmarked-up price atuomatically.So why does the simple [price] work in your Details.tpl page, you ask?It's because in that case you're performing a search in a database, andinside that search's [FoundItems] loop WebCatalog has enough contextualinformation to know how to find the [price] information. Your banner ad is*not* doing such a search, so it can't know the price unless you explicitlytell it to look it up in a database.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>Thanks, this does work and displays the price. However, I also have a>markup of>the price and the markup works fine in the details.tpl but not with the>banner ad>and I can't seem to figure out what I need to change to get it to work.The reason is that just putting [price] into your banner ad is not enoughfor WebCatalog to know what the price should be. It needs to know whatdatabase to look in, what sku to look for, etc. That's why you use the
[lookup] to find the price. So from a simplistic standpoint, if yousubstitute that big
[lookup] everywhere you need [price] in your big mathequation, then you'd get the right information.There is a way to simplify this with an
[include], though, so you don'thave to do so much typing:-- MarkupCalc.inc --(put that big bunch of
[showif] with
[math] text here)Then anywhere you need the marked-up price (even on your details.tpl page), use[include file=MarkupPrice.inc&price=[Lookupdb=catalog.txt&lookinfield=sku&value=[sku]&returnfield=price]]You're basically making a 'macro' that takes a SKU and looks up itsmarked-up price atuomatically.So why does the simple [price] work in your Details.tpl page, you ask?It's because in that case you're performing a search in a database, andinside that search's
[founditems] loop WebCatalog has enough contextualinformation to know how to find the [price] information. Your banner ad is*not* doing such a search, so it can't know the price unless you explicitlytell it to look it up in a database.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
PCS Technical Support
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:
RE: Nesting [ListFiles] (1998)
Add a field to the error log? (1997)
What am I missing (1997)
Roundup function? (1997)
Emailer Error 550 (Was Strange Crash) (1998)
WebCat2final1 crashes (1997)
Help with Shipping Costs (1997)
off-topic: SMS interface? (2001)
[math] oddness .. (2002)
The List is Changing (1997)
what include am I using! (2005)
rotating thumbnails (1997)
Unusual characters in the db ... (2002)
Bug Report, maybe (1997)
[WebDNA] Talk archives (2010)
database files in secure folder (1997)
Directory Overload (1998)
Secure server question (1997)
a little help w/ this .debug error (2000)
Problems setting MIME Headers (1998)