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 enough for WebCatalog to know what the price should be. It needs to know what database 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 you substitute that big [lookup] everywhere you need [price] in your big math equation, then you'd get the right information.There is a way to simplify this with an [include], though, so you don't have 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=[Lookup db=catalog.txt&lookinfield=sku&value=[sku]&returnfield=price]]You're basically making a 'macro' that takes a SKU and looks up its marked-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, and inside that search's [FoundItems] loop WebCatalog has enough contextual information 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 explicitly tell 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 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Display [price] in banner ad (PCS Technical Support 1998)
  2. Re: Display [price] in banner ad (Mark Bergkvist 1998)
  3. Re: Display [price] in banner ad (PCS Technical Support 1998)
  4. Re: Display [price] in banner ad (Mark Bergkvist 1998)
  5. Re: Display [price] in banner ad (PCS Technical Support 1998)
  6. Re: Display [price] in banner ad (Mark Bergkvist 1998)
  7. Re: Display [price] in banner ad (Kenneth Grome 1998)
  8. Display [price] in banner ad (Mark Bergkvist 1998)
>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 enough for WebCatalog to know what the price should be. It needs to know what database 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 you substitute that big [lookup] everywhere you need [price] in your big math equation, then you'd get the right information.There is a way to simplify this with an [include], though, so you don't have 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=[Lookup db=catalog.txt&lookinfield=sku&value=[sku]&returnfield=price]]You're basically making a 'macro' that takes a SKU and looks up its marked-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, and inside that search's [founditems] loop WebCatalog has enough contextual information 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 explicitly tell 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 | Typhoon 619/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)