Re: Display [price] in banner ad

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19783
interpreted = N
texte = PCS Technical Support wrote:> >I am working on a store that has thousands of items and have created some > >banner > >ads for featured products. I have got it so that when a person clicks on an > >specific ad it takes them to the details.tpl for that specific product. > > OK, assuming your banner ads database has a SKU field in it, and your > product database is called Catalog.db, you can do something like the > following: > > Price is: [Lookup > db=Catalog.db&lookInField=sku&value=[sku]&returnField=price¬Found=Unknown] > > This does a lookup in your product database, looking for the sku from your > banner ads databaseThanks, 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.Here is the code I have in the banner ad that displays the price, but without the markup:
On Special for only $[Lookup db=catalog.txt&lookinfield=sku&value=455303&returnfield=price]
And here is the code I have in the details.tpl that displays the price with the markup:$[format .2f] [math show=f]markup=.04[/math][ShowIf [price]<2500][math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<2000][math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<1000] [math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<500][math show=f]markup=.05[/math][/ShowIf][ShowIf [price]<400][math show=f]markup=.06[/math][/ShowIf][ShowIf [price]<300][math show=f]markup=.07[/math][/ShowIf][ShowIf [price]<200][math show=f]markup=.09[/math][/ShowIf][ShowIf [price]<100][math show=f]markup=.11[/math][/ShowIf][ShowIf [price]<75][math show=f]markup=.12[/math][/ShowIf][ShowIf [price]<50][math show=f]markup=.25[/math][/ShowIf][ShowIf [price]<30][math show=f]markup=.30[/math][/ShowIf][ShowIf [price]<20][math show=f]markup=.35[/math][/ShowIf][ShowIf [price]<10][math show=f]markup=.40[/math][/ShowIf][ShowIf [price]<5][math show=f]markup=.60[/math][/ShowIf][math][price]/(1-markup)[/math][/format]The details.tpl has some [foundItems] tags in it and I think they may have something to do with it, but haven't been able to figure out if that has anything to do with it yet.Any suggestions????Thanks again for everyones help! Mark B. 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)
PCS Technical Support wrote:> >I am working on a store that has thousands of items and have created some > >banner > >ads for featured products. I have got it so that when a person clicks on an > >specific ad it takes them to the details.tpl for that specific product. > > OK, assuming your banner ads database has a SKU field in it, and your > product database is called Catalog.db, you can do something like the > following: > > Price is: [Lookup > db=Catalog.db&lookInField=sku&value=[sku]&returnField=price¬Found=Unknown] > > This does a lookup in your product database, looking for the sku from your > banner ads databaseThanks, 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.Here is the code I have in the banner ad that displays the price, but without the markup:[cart]&eqskudata=455303>
On Special for only $[Lookup db=catalog.txt&lookinfield=sku&value=455303&returnfield=price]
And here is the code I have in the details.tpl that displays the price with the markup:$[format .2f] [math show=f]markup=.04[/math][ShowIf [price]<2500][math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<2000][math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<1000] [math show=f]markup=.04[/math][/ShowIf][ShowIf [price]<500][math show=f]markup=.05[/math][/ShowIf][ShowIf [price]<400][math show=f]markup=.06[/math][/ShowIf][ShowIf [price]<300][math show=f]markup=.07[/math][/ShowIf][ShowIf [price]<200][math show=f]markup=.09[/math][/ShowIf][ShowIf [price]<100][math show=f]markup=.11[/math][/ShowIf][ShowIf [price]<75][math show=f]markup=.12[/math][/ShowIf][ShowIf [price]<50][math show=f]markup=.25[/math][/ShowIf][ShowIf [price]<30][math show=f]markup=.30[/math][/ShowIf][ShowIf [price]<20][math show=f]markup=.35[/math][/ShowIf][ShowIf [price]<10][math show=f]markup=.40[/math][/ShowIf][ShowIf [price]<5][math show=f]markup=.60[/math][/ShowIf][math][price]/(1-markup)[/math][/format]The details.tpl has some [founditems] tags in it and I think they may have something to do with it, but haven't been able to figure out if that has anything to do with it yet.Any suggestions????Thanks again for everyones help! Mark B. Mark Bergkvist

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:

Version number missing (was Mondo amounts of Mail [long]) (1999) Quickie question on the email templates (1997) cart info (1998) HomePage Caution (1997) NY State Zip Codes & Tax percent (2002) Using files in an Email broadcast (1999) WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997) RE: what characters are replaced for tab and CR? (1998) Kaaaaahhhhhhhnnnnnnn! (1997) [WebDNA] grep again (2010) How do I access a shopping cart once it had been moved (2000) Database (1999) bug in wn searching NT version? (1997) Can't load tmpl files (1997) FYI: virus alert (1996) Sharing DBs across domains (2001) Multiple Ad databases? (1997) [WriteFile] problems (1997) [OT] Movie (2002) NT Setup (1998)