zebra001 Posted May 6, 2003 Share Posted May 6, 2003 Does anyone know what would need to be done to pull new monthly products from only 1 catagory. I attached the code that I think will need to be modified, can't figure it out.. 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' 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); } This is important because we have main products and then accessories for those products. There are 100's of accessories and only a few main product . Any help or suggestions would be great... Thanks all and keep up the good work. cheers, -J Link to comment Share on other sites More sharing options...
zebra001 Posted May 8, 2003 Author Share Posted May 8, 2003 Has any one come across this before.. -J Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.