Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

in the new snapshot, making new products random


4 replies to this topic

#1 Trusten

  • Community Member
  • 624 posts
  • Real Name:Trusten

Posted 08 November 2002, 09:01

I can't seem to get the new products random like i once had.


please help.

#2 Trusten

  • Community Member
  • 624 posts
  • Real Name:Trusten

Posted 08 November 2002, 16:31

bump

#3 mikimoto

  • Community Member
  • 33 posts
  • Real Name:miki moto
  • Location:Spain

Posted 31 January 2003, 16:35

same question :roll:

#4 burt

  • Community Sponsor
  • 6,955 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 31 January 2003, 16:48

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

    $new_products_query = tep_db_query("select p.products_id, 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' AND p.products_image != '' AND p.products_image != 'Array' order by RAND() DESC limit " . MAX_DISPLAY_NEW_PRODUCTS);

  } else {

    $new_products_query = tep_db_query("select distinct p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' order by RAND() DESC limit " . MAX_DISPLAY_NEW_PRODUCTS);

  }


Shows products *with an image* randomly on page reload. Works in the 14/01/2003 snapshot.

#5 mikimoto

  • Community Member
  • 33 posts
  • Real Name:miki moto
  • Location:Spain

Posted 31 January 2003, 17:29

All right now :)

Thank you very much :wink: