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:

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)