zeberrun Posted April 12, 2008 Share Posted April 12, 2008 To show random new products, i have done that, but shows all the products, pleas help me file adress: modules/new products.php list($usec, $sec) = explode(' ', microtime()); srand( (float) $sec + ((float) $usec * 100000) ); $mtm= rand(); if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // in index.php $new_products_query = tep_db_query("select p.products_id, p.fr_currencies_id, p.products_list_price, p.products_model, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added, rand($mtm) DESC limit " . MAX_DISPLAY_NEW_PRODUCTS); Link to comment Share on other sites More sharing options...
burt Posted April 12, 2008 Share Posted April 12, 2008 To show random new products, i have done that $new_products_query = tep_db_query("select p.products_id, p.fr_currencies_id, p.products_list_price, p.products_model, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS); Link to comment Share on other sites More sharing options...
zeberrun Posted April 13, 2008 Author Share Posted April 13, 2008 $new_products_query = tep_db_query("select p.products_id, p.fr_currencies_id, p.products_list_price, p.products_model, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS); thanks for reply but still shows all the products by random. Link to comment Share on other sites More sharing options...
burt Posted April 14, 2008 Share Posted April 14, 2008 Check what you have for MAX_DISPLAY_NEW_PRODUCTS Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.