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:

[delete] problem (1997) F3 crashing server (1997) exclusive db lock with webcat-3 ? (2000) searchable list archive (1997) WebDNA v6 & MySQL (2008) Summ=T Problem (1997) Secure Server (1999) [OT] Forums - check it out (2005) [OT] md5 or sha-1 on OSX (2007) Tax and ShipCost Problem (1997) WebCatalog2 Feature Feedback (1996) FYI: virus alert (1996) Random (2000) Kaaaaahhhhhhhnnnnnnn! (1997) remotely creating and populating a stock inventory db - almost there! (1999) Bookmarked URL with cart (1998) [WebDNA] Using WebDNA with MAMP (2010) Include vs. lookup? (1998) Finding max value for a field (1997) Very serious bug with the [protect] tag (2003)