Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

random new products


zeberrun

Recommended Posts

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

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

$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

Archived

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

×
×
  • Create New...