Hello!!!
I have changed the query's function of get_random_cat_image to that:
$produkt_query = tep_db_query( "select distinct p.products_image as img ".
"from products p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ".
"where p.products_id = pd.products_id and ".
"p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . $category_id . "' in (c.categories_id, c.parent_id) ".
"order by pd.products_viewed desc, pd.products_name limit 10");
Then the showcase is a selection of the most viwed products images, and causes more impact.
But there is a little problem: I have some products repeted on some categories and sometimes the images are repeated. How can I do to solve that?
Sorry but maybe is a little dummy question because I'm a newbie at php.
Thank you.