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:
WCS Newbie question (1997)
IP Address Ranges in a Database. (2003)
cron script for housekeeping and running WebCatalog? (1999)
[WebDNA] [array] (2009)
Using WC for Bulk Emailings (1997)
[sendmail] questions... (1997)
Test message (2008)
Date format (2000)
Showif, Hideif reverse logic ? (1997)
WebCatalog2 Feature Feedback (1996)
For those of you not on the WebCatalog Beta... (1997)
re: Large databases in WebCat (1997)
WebCatalog for Postcards ? (1997)
search results through frames (2000)
Search Context: How to set Max=N? (2000)
A Current Feature or Futre Concept (1998)
version 2 for NT (1997)
Maybe minor bug report (1997)
problem: mail changed (1997)
Version f1 status (1997)