Thursday, March 24, 2011

List random products from category in osCommerce

I was asked to implement a random product listing for an osCommerce on-line store. I can do some basic PHP but the store uses a framework of its own and I'm clueless how to do it. First I try to make a random list just on the front page: I open index.php and find the

include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

line after which I add

include(DIR_WS_MODULES . "random_products.php");

but what should I put in it? I checked the upcoming_products.php to find some SQL I could modify and maybe a loop over the products but there is no such things in it. So how do I do it without having to check table structure/include files?

From stackoverflow
  • Solved. I used new_products.php which is clearer: I modified the title and changed order in the SQL to RAND().

0 comments:

Post a Comment