Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

stumped! new products box in one particular category


Guest

Recommended Posts

Hi,

 

I'm a newbie with no real background in this kind of thing (1st post on any forum..... ever!), am muddling through and have set up a site www.dknoise.co.uk. I have one particular issue that is not mission critical but is bugging me somewhat.

The "new products" box shows (with contents) in all my categories bar one, namely "P.A. speakers" or "http://www.dknoise.co.uk/catalogue/index.php?cPath=51". I have obviously made a mess of things somehow but have no-idea how to solve it.

 

I await your collective superior wisdom on the matter :blink:

 

Regards

 

Dom

Link to comment
Share on other sites

I have obviously made a mess of things somehow but have no-idea how to solve it.

Don't think you made a mess but category 51 itself doesn't contain any products, it "only" has two subcategories. That explains why you don't see new products in it.

 

I think they solved this in featured products with this piece of code:

	$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, NULL as products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 } else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $featured_products_category_id);
$featured_products_category_id_list = tep_array_values_to_string($subcategories_array);
if ($featured_products_category_id_list == '') {
  $featured_products_category_id_list .= $featured_products_category_id;
} else {
  $featured_products_category_id_list .= ',' . $featured_products_category_id;
}
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, NULL as products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where c.parent_id in (" . $featured_products_category_id_list . ") and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
}

Link to comment
Share on other sites

Don't think you made a mess but category 51 itself doesn't contain any products, it "only" has two subcategories. That explains why you don't see new products in it.

 

I think they solved this in featured products with this piece of code:

	$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, NULL as products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 } else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $featured_products_category_id);
$featured_products_category_id_list = tep_array_values_to_string($subcategories_array);
if ($featured_products_category_id_list == '') {
  $featured_products_category_id_list .= $featured_products_category_id;
} else {
  $featured_products_category_id_list .= ',' . $featured_products_category_id;
}
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, NULL as products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where c.parent_id in (" . $featured_products_category_id_list . ") and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
}

 

what I mean is when you click "p.a. speakers" the "new products fo april" box is empty. This is the only place on the site where this occurs.

Link to comment
Share on other sites

what I mean is when you click "p.a. speakers" the "new products fo april" box is empty. This is the only place on the site where this occurs.

Again: Category 51 (p.a. speakers) itself doesn't contain any products, it "only" has two subcategories. That explains why you don't see new products in it.

Link to comment
Share on other sites

what I mean is when you click "p.a. speakers" the "new products fo april" box is empty. This is the only place on the site where this occurs.

 

Jan is correct.

 

:thumbsup: I think you would be better served by installing the Featured Products contribution that replaces the New Products for Month box with a box that gives you complete control of what products are listed. It also allows for Featured Products for specific categories, etc.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Again: Category 51 (p.a. speakers) itself doesn't contain any products, it "only" has two subcategories. That explains why you don't see new products in it.

The penny hath finally dropped. Thank you.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...