Re: Can this be done?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 12275
interpreted = N
texte = >>Is it possible to have WebCat. randomly pick (4) of you 2,000 products/sku's,>>take 5% off of the price, display the info., i.e. name, description, sku,>>etc..., on a page for 24 hours, and than change it to (4) other items for the>>next 24hrs.?>>Not a problem, although it requires some thorough knowledge of databases>and WebDNA. Ken uploaded a sample called DailyTotals, I think, that>shows how to perform something only once a day. As for the rest, you can>pick 4 by doing a search with a random sort and max=4, then either render>those 4 out to a static HTML page, or mark them in your catalog as being>today's specials. If you add a field that marks them as specials, then>you can create a price formula that does the discount if it sees the>'specials' flag set.Grant's excellent suggestion of adding a field named 'specials' would beuseful for another feature, too.Let's say you want WebCat2 to offer 4 'special items' each day (as youmentioned above) but you don't want to repeat any of these specials ...until every one of your 2000 items has been offered as a special at leastonce.In this case, you can mark each of the special items by putting a T intothe new 'specials' field as it is offered. Then, by adding&nespecialsdatarq=T to your search string, this will preventpreviously-marked specials from being included as future specials ... untilall the items in the database have been offered as specials at least once.With 4 specials per day and a total of 2000 items, it will take you 500days to offer all your items as specials the first time ... then you canreset the value of 'specials' in all your records from T to F using[replace], and start all over for the next 500 days. Even more interestingis that you can automate the [replace] so it happens exactly when it should...You can put the [replace] inside a [showif] context that only shows when[numfound]<4. That way, WebCat2 will reset the 'specials' valueautomatically ... but only after reaching the final 4 randomly-selectedspecials in the database.This [replace] would automatically occur at the 'proper time' no matter howmany items you choose to add to of remove from your database in themeantime ... so you would never have to think about it again.In other words, it offers a completely automated solution that just keepsgoing and going and going ... kind of like the Energizer bunny! :)Sincerely, Ken GromeWebDNA Solutions
Associated Messages, from the most recent to the oldest:
>>Is it possible to have WebCat. randomly pick (4) of you 2,000 products/sku's,>>take 5% off of the price, display the info., i.e. name, description, sku,>>etc..., on a page for 24 hours, and than change it to (4) other items for the>>next 24hrs.?>>Not a problem, although it requires some thorough knowledge of databases>and WebDNA. Ken uploaded a sample called DailyTotals, I think, that>shows how to perform something only once a day. As for the rest, you can>pick 4 by doing a search with a random sort and max=4, then either render>those 4 out to a static HTML page, or mark them in your catalog as being>today's specials. If you add a field that marks them as specials, then>you can create a price formula that does the discount if it sees the>'specials' flag set.Grant's excellent suggestion of adding a field named 'specials' would beuseful for another feature, too.Let's say you want WebCat2 to offer 4 'special items' each day (as youmentioned above) but you don't want to repeat any of these specials ...until every one of your 2000 items has been offered as a special at leastonce.In this case, you can mark each of the special items by putting a T intothe new 'specials' field as it is offered. Then, by adding&nespecialsdatarq=T to your search string, this will preventpreviously-marked specials from being included as future specials ... untilall the items in the database have been offered as specials at least once.With 4 specials per day and a total of 2000 items, it will take you 500days to offer all your items as specials the first time ... then you canreset the value of 'specials' in all your records from T to F using
[replace], and start all over for the next 500 days. Even more interestingis that you can automate the
[replace] so it happens exactly when it should...You can put the
[replace] inside a
[showif] context that only shows when[numfound]<4. That way, WebCat2 will reset the 'specials' valueautomatically ... but only after reaching the final 4 randomly-selectedspecials in the database.This
[replace] would automatically occur at the 'proper time' no matter howmany items you choose to add to of remove from your database in themeantime ... so you would never have to think about it again.In other words, it offers a completely automated solution that just keepsgoing and going and going ... kind of like the Energizer bunny! :)Sincerely, Ken GromeWebDNA Solutions
Kenneth Grome
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:
Using Applescript to process WebCatalog functions (1998)
Emailer setup (1997)
Summ=T Problem (1997)
Separate SSL Server (1997)
[WebDNA] [listwords] and [index] (2009)
Template Not Found (1998)
PCS Frames (1997)
[writefile] and CR's (2001)
Date field search needs ... (1998)
OK, here goes... (1997)
Multiple prices (1997)
Apache suffix mapping for .tpl (2000)
[WebDNA] Need some PHP help (2009)
graphic to appear automatically... (2000)
Encrypt (2000)
Umm...about those log files? (Off Topic) (1997)
Semi OT: IE losing info from forms when back button is used (2005)
math variable security [VERY LONG] (2000)
WebCat2 beta 11 - new prefs ... (1997)
searchable list archive (1997)