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:
Stopping bad HTML propagation ? (1997)
WebCatalog f2 Installation (1997)
Where's Cart Created ? (1997)
[OT] Bush's Cyberensive (2003)
Message Board (again:-) (2000)
Temp DB (Was freeze) (2003)
WebDNA and FTP (2003)
Database field limit? (1998)
BUG?-.html extention not working. (2000)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
Help name our technology! I found it (1997)
upgrading (1997)
[append] and SSL (1997)
How to unsubscribe (2000)
Re[2]: Next X hits (1996)
More on the email templates (1997)
Summing fields (1997)
textA and Title? (1997)
tcpconnect/tcpsend frustrations (2002)
A Global Variable (1997)