Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What's New


jasonabc

Recommended Posts

Posted

Getting a very weird problem on this store - wonder if a fresh pair of eyes could take a look? When you open a top level category (Ammunition) - the sub category links are displayed at the top - but the "New Products for March" items are missing. The really strange thing is that if I View Source - the New Products table is being written out - it's just empty:

 

<!-- new_products //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="4">

</table>

</td>

</tr>

</table>

<!-- new_products_eof //-->

 

 

If you go one category deeper (Duty/Defence) - the new products module works fine. The newest products are displayed. Any thoughts?

 

http://s13711.gridserver.com/index.php?cPath=1

Posted

have you checked the new_products.php module code? Are there any conditions with the sql queries?

Posted

Hey Mark - yeah I replaced new_products.php with one from a fresh download of OSC and no luck. I also replaced /index.php from the same download and to no avail. Same problem. The other weird thing is if I put a product in Ammunition - it behaves like I've reached the last/deepest category and calls product_listing....

Posted

ok open your catalog\includes\modules\new_products.php find this code:

 

  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);
 }

 

replace it with

	$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);

 

if it works trace back the $new_products_category_id variable in the catalog\index.php where it should be set.

Archived

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

×
×
  • Create New...