Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Urgent! Make New Products display 1category only


Guest

Recommended Posts

Need help!!!

 

I need to make the NEW FOR MONTH info box display 1 category only. I believe the file that needs to be modified is new_products.php.

 

lines 18-24 or about...

 

new contentBoxHeading($info_box_contents);

 

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 p.products_date_added 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 = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

I don't mind hard-coding the correct category # at this time, and have tried, but to no avail...

 

I actually have 2 new products for month boxes used on the index page, 1 is standard, the other needs to display all products from a certain category, in the same format as the new products for month box. That is why I chose that file to copy and modify. If the new file is left without modifications, it displays just like a duplicate of the new products for month. When I try to specify a catagory, the list is just blank...

 

Thanks in advance, and again, this is urgent...

 

If there is any other way or suggestions please let me know...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...