[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Randomly picking a product
Sorry!
I meant to always post my 'solutions'. :-)
In this case, I really can't claim to have solved the problem. I don't want to count throught the products each time a page is served (too resource-consuming) and I couldn't think of another way to randomly select a product, so here's what I did:
My objective was to have, on my home page, a changing "Featured Product" display. I have accomplished this, only it isn't random. I added a field, 'days', to products.asc. This field can contain numbers (1 to 31) separated by spaces, or it can be blank. You guessed it- the numbers determine which days of the month a particular product will be featured on my home page. Then, on my page, I place an in-page search as follows:
[loop search="
se=[calc]@timelist = localtime;$mday = $timelist[3];return $mday;[/calc]
su=yes
sf=days
ml=1
"]
[loop-description]
[page href="[loop-code]" send=1]More Information</a>[/loop]
That's all I did! It accomplished my purpose- showing a different display every day- and it can be configured in advance. One caveat- make sure that *every* day of the month is somewhere in a 'days' field in products.asc. Otherwise, on that forgotten day, the page sure will look funny (empty).
HTH,
Rob Maurer
*****************************************
Hello minivend-users,
the question was announced a few days ago by Rob Maurer (23.10.) as I found
in the archive. But I did'nt see a solution.
Rob, if you read this, did you solve your problem yourself? I would be very
interested in that solution.
Or is there anyone else with an idea?
Sincerely
Holger Matschinski