VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Questions VM 1.1 ( the only active board for the old version) => Topic started by: 1gna753 on November 30, 2011, 23:00:13 pm

Title: Handling Random product results
Post by: 1gna753 on November 30, 2011, 23:00:13 pm
Hello world!  ;D

Is it possible to generate a random-product-result through Top Menu?

Currently, it is being sorted by product name. (ORDER BY statement).
Each time I navigate through page results it makes the same query but a limit statement is used. (So same query but it takes different elements...)
First from 0 to 16.
Second from 17 to 32.
And so on...

There is a RANDOM() function in MySQL queries and it works perfect.

The problem is that when you navigate to the next page you may get already-seen product (because it is random).  :-\

Is there any way to keep shown-product IDs in a static-global-php array variable?  :o

As far as I can see it, it maybe a problem if you want to navigate backwards.
I guess it should remember/store the previous result.