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 be useful for another feature, too.Let's say you want WebCat2 to offer 4 'special items' each day (as you mentioned 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 least once.In this case, you can mark each of the special items by putting a T into the new 'specials' field as it is offered. Then, by adding &nespecialsdatarq=T to your search string, this will prevent previously-marked specials from being included as future specials ... until all 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 500 days to offer all your items as specials the first time ... then you can reset 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 interesting is 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' value automatically ... but only after reaching the final 4 randomly-selected specials in the database.This [replace] would automatically occur at the 'proper time' no matter how many items you choose to add to of remove from your database in the meantime ... so you would never have to think about it again.In other words, it offers a completely automated solution that just keeps going and going and going ... kind of like the Energizer bunny! :)Sincerely, Ken Grome WebDNA Solutions Associated Messages, from the most recent to the oldest:

    
  1. Re: Can this be done? ( "Jesse Crofoot" 2004)
  2. Re: Can this be done? ( Joe D'Andrea 2004)
  3. Re: Can this be done? ( charles kline 2004)
  4. Can this be done? ( "Jesse Crofoot" 2004)
  5. Re: Can this be done? ( Lester 2003)
  6. Re: Can this be done? ( Kenneth Grome 2003)
  7. Re: Can this be done? ( Gary Krockover 2003)
  8. Re: Can this be done? ( Lester 2003)
  9. Re: Can this be done? ( Kenneth Grome 2003)
  10. Re: Can this be done? ( Donovan Brooke 2003)
  11. Re: Can this be done? ( Lester 2003)
  12. Re: Can this be done? ( Tim Robinson 2003)
  13. Re: Can this be done? ( Tim Robinson 2003)
  14. Re: Can this be done? ( Lester 2003)
  15. Re: Can this be done? ( Tim Robinson 2003)
  16. Can this be done? ( Lester 2003)
  17. Re:Can this be done? (Jay Van Vark 1997)
  18. Re: Can this be done? (Kenneth Grome 1997)
  19. Re: Can this be done? (Grant Hulbert 1997)
  20. Can this be done? (MallonT@aol.com 1997)
>>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 be useful for another feature, too.Let's say you want WebCat2 to offer 4 'special items' each day (as you mentioned 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 least once.In this case, you can mark each of the special items by putting a T into the new 'specials' field as it is offered. Then, by adding &nespecialsdatarq=T to your search string, this will prevent previously-marked specials from being included as future specials ... until all 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 500 days to offer all your items as specials the first time ... then you can reset 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 interesting is 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' value automatically ... but only after reaching the final 4 randomly-selected specials in the database.This [replace] would automatically occur at the 'proper time' no matter how many items you choose to add to of remove from your database in the meantime ... so you would never have to think about it again.In other words, it offers a completely automated solution that just keeps going and going and going ... kind of like the Energizer bunny! :)Sincerely, Ken Grome WebDNA 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)