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:
problems with 2 tags (1997)
calculate age (2003)
Slightly OT: Regex and Date Modified/Created (2002)
What is WebDNA (1997)
Search in 2 or more catalogs (1997)
& not allowed in db by definition? (1999)
'RequiredField' Question (1998)
taxTotal, too (1997)
How many lookups does it take ... (2003)
WC1.6 to WC2 date formatting (1997)
Weird variable behaviour (2002)
Is there an easier way? (1998)
Revisit: speed test (2002)
Conditional searching & displaying (1997)
Help name our technology! (1997)
[WebDNA] Setting Content-Type within [returnraw] - not working on Linux (2010)
DON'T use old cart file! (1997)
Emailer & WebStar Mail and 551 Error (2000)
Erotic Sites (1997)
Re:What file? (1997)