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 ofthe price and the markup works fine in the details.tpl but not with the banner adand 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 themarkup:
On Special for only $[Lookupdb=catalog.txt&lookinfield=sku&value=455303&returnfield=price]And here is the code I have in the details.tpl that displays the price with themarkup:
$[format .2f] [math show=f]markup=.04[/math][ShowIf [price]<2500][mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<2000][mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<1000] [mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<500][mathshow=f]markup=.05[/math][/ShowIf][ShowIf [price]<400][mathshow=f]markup=.06[/math][/ShowIf][ShowIf [price]<300][mathshow=f]markup=.07[/math][/ShowIf][ShowIf [price]<200][mathshow=f]markup=.09[/math][/ShowIf][ShowIf [price]<100][mathshow=f]markup=.11[/math][/ShowIf][ShowIf [price]<75][mathshow=f]markup=.12[/math][/ShowIf][ShowIf [price]<50][mathshow=f]markup=.25[/math][/ShowIf][ShowIf [price]<30][mathshow=f]markup=.30[/math][/ShowIf][ShowIf [price]<20][mathshow=f]markup=.35[/math][/ShowIf][ShowIf [price]<10][mathshow=f]markup=.40[/math][/ShowIf][ShowIf [price]<5][mathshow=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 havesomething to do with it, but haven't been able to figure out if that has anythingto do with it yet.Any suggestions????Thanks again for everyones help!Mark B.
Associated Messages, from the most recent to the oldest:
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 ofthe price and the markup works fine in the details.tpl but not with the banner adand 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 themarkup:
[cart]&eqskudata=455303>
On Special for only $[Lookupdb=catalog.txt&lookinfield=sku&value=455303&returnfield=price]And here is the code I have in the details.tpl that displays the price with themarkup:
$[format .2f] [math show=f]markup=.04[/math][ShowIf [price]<2500][mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<2000][mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<1000] [mathshow=f]markup=.04[/math][/ShowIf][ShowIf [price]<500][mathshow=f]markup=.05[/math][/ShowIf][ShowIf [price]<400][mathshow=f]markup=.06[/math][/ShowIf][ShowIf [price]<300][mathshow=f]markup=.07[/math][/ShowIf][ShowIf [price]<200][mathshow=f]markup=.09[/math][/ShowIf][ShowIf [price]<100][mathshow=f]markup=.11[/math][/ShowIf][ShowIf [price]<75][mathshow=f]markup=.12[/math][/ShowIf][ShowIf [price]<50][mathshow=f]markup=.25[/math][/ShowIf][ShowIf [price]<30][mathshow=f]markup=.30[/math][/ShowIf][ShowIf [price]<20][mathshow=f]markup=.35[/math][/ShowIf][ShowIf [price]<10][mathshow=f]markup=.40[/math][/ShowIf][ShowIf [price]<5][mathshow=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 havesomething to do with it, but haven't been able to figure out if that has anythingto 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)