Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product no longer on front page - osc 2.3.1


blr044

Recommended Posts

A few days ago, the products for the month was fine. Today, it is no longer on front page. url is www dot greadiscounts4u dot com

 

This is the bottom section index.php file:

<h3><?php echo HEADING_TITLE; ?></h3>

<div class="contentContainer">

<?php
   if (tep_not_null(TEXT_MAIN)) {
?>

 <div class="mainparg">
   <?php echo TEXT_MAIN; ?>
 </div>

<?php
   }

   include(DIR_WS_MODULES . FILENAME_FEATURED);
//    include(DIR_WS_MODULES . FILENAME_SPECIALS); 
   include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);    
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

</div>

<?php
 }

 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

this is the code from includes/modules/new_products.php:

  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, pd.products_name, 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_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' AND p.products_date_added> date_sub(NOW( ), INTERVAL 1 MONTH) order by RAND() 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, pd.products_name, 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_DESCRIPTION . " pd, " . 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' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 $num_new_products = tep_db_num_rows($new_products_query);

 if ($num_new_products_query > 0) {
   $counter = 0;
   $col = 0;

   $new_prods_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">';
   while ($new_products = tep_db_fetch_array($new_products_query)) {
     $counter++;

     if ($col === 0) {
       $new_prods_content .= '<tr>';
     }

     $new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br />' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</td>';

     $col ++;

     if (($col > 2) || ($counter == $num_new_products)) {
       $new_prods_content .= '</tr>';

       $col = 0;
     }
   }

   $new_prods_content .= '</table>';
?>

 <div class="ui-widget infoBoxContainer">
   <div class="ui-widget-header ui-corner-top infoBoxHeading">  <?php echo sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')); ?></div>
 <div class="ui-widget-content ui-corner-bottom infoBoxContents">  <?php echo $new_prods_content; ?>

</div>
</div>
<?php
 }
?>

 

Am not seeing what went wrong. so if a member has time to look at code, I be very grateful.

 

Thanks.

Link to comment
Share on other sites

Did you add any products the last month?

 

 

Did add products on eight products this month. even added a test product yesterday, just to check it out, but still the product for the month is missing.

Link to comment
Share on other sites

It is working fine now. The reason why it stopped displaying the products for the month was because of a change I did to includes/modules/new_products.php. I was trying to control new_products for the month. If zero new products, then new_products for the month would not display. I see this post. But I miss-understood it, so it was my mistake. Sorry.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...