Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is it possible to randomize the sort of products?


giulomas

Recommended Posts

Hi everyone!

 

I wonder if is there any chance to change the sort of products in random style: now my products are showing sorted by date, instead I would they are sorted in random mode...

 

<?php
$products_new_added_query = tep_db_query("select distinct pd.products_id, pd.products_name, pd.products_description, p.products_date_added, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name limit 10");
?>

 

I hope I have explained my issue - sorry for my bad english!

 

Thanks for any help

 

Giuliano

Link to comment
Share on other sites


<?php

$products_new_added_query = tep_db_query("select distinct pd.products_id, pd.products_name, pd.products_description, p.products_date_added, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rand() limit 10");

?>

Link to comment
Share on other sites

  • 11 months later...

@@wHiTeHaT hello,  I hope  maybe you can help

 

My problem is  , my new products  are showed on my last page ? 

 

is this by default  ?  

 

, if i add a new product , then you must see this product on the first page of yor category , is this right ? 


not oldest product first , but new products have priority to be on the First page ? 


now my newest products , shows on my last page, ?

 

i must scroll to the latest page , is there a add-on, or solution too see my newest products in the first page ? maybe SORT  by date ?  or another solution ?

 

Thanks for help 


Thanks for yor answer !

Link to comment
Share on other sites

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...