Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Featured 1.5


defender39

Recommended Posts

I just installed this contribution after getting rid of the previous version 1.3- and it is running fine except for two things.

 

When I click on the "Featured Products" link in the header bar, then specials.php comes up (which is blank because I have no specials) Does anyone know how to direct that link instead to a page of listed Featured Products (preferably with a buy now button beside each?

 

Second, I am not sure why- but in the previous version that I had installed- a short description showed up in each featured product listing. I can't remember if I did some hack for that, or if there is some way to do this easily.

 

Thanks for any advice

 

Catherine

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 94
  • Created
  • Last Reply

Top Posters In This Topic

Just installed v1.51, and it looks like I did everything correct.

Database now includes 10 new products to be expired 1.4.2004

 

But...

I don't see them on the main page. I see only the last 10 products added to the catalog.

I'm using a template, so this can be connected somehow.

 

Here's my index.php:

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [URL=http://www.oscommerce.com]http://www.oscommerce.com[/URL]

 Copyright ? 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
   $cateqories_products = tep_db_fetch_array($categories_products_query);
   if ($cateqories_products['total'] > 0) {
     $category_depth = 'products'; // display products
   } else {
     $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
     $category_parent = tep_db_fetch_array($category_parent_query);
     if ($category_parent['total'] > 0) {
       $category_depth = 'nested'; // navigate through the categories
     } else {
       $category_depth = 'products'; // category has no products, but display the 'no products' message
     }
   }
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
// ADDED BY CLEMENT for design  
 define('HEADING_IMAGE_FILE', 'table_background_default.gif');
 require(DIR_WS_INCLUDES . FILENAME_DESIGN);
//**  
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML <?php echo HTML_PARAMS; ?>>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<?php echo CHARSET; ?>"> 
<TITLE><?php echo TITLE; ?></TITLE>
<BASE HREF="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<LINK REL="stylesheet" TYPE="text/css" HREF="stylesheet.css">
<?php echo HEAD_TAGS; ?>

<?php echo BODY_TAG; ?>

<!-- header //-->

<?php
require(DIR_WS_INCLUDES . 'header.php'); 


if (COLUMN_LEFT_DISPLAY == 'true') {
echo '<!-- left_navigation //-->';
require(DIR_WS_INCLUDES . 'column_left.php'); 
echo '<!-- left_navigation_eof //-->';
}
?>

<!-- body_text //-->
<?php
 if ($category_depth == 'nested') {
   $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <TD <?php echo CONTENT_PARAM_FIRST_TD; ?>>

      <?php // echo CONTENT_TOP_FIRST_TD; ?>

<TABLE <?php echo CONTENT_PARAM_FIRST_TABLE; ?>>

     <TR>
       <TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
         <TR>
           <td class="pageHeading">
            <?php 
              if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
                echo $category['categories_heading_title'];
              } else {
                echo HEADING_TITLE;
              }
            ?>
           </td>
         </TR>
       </TABLE></TD>
     </TR>
<?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  <tr>
           <td align="right" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
  </tr>
  <?php } ?>
     <TR>
       <TD><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></TD>
     </TR>
     <TR>
       <TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="2">
         <TR>
           <TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="2">
             <TR>
<?php
   if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
     $category_links = array_reverse($cPath_array);
     for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
       $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
       $categories = tep_db_fetch_array($categories_query);
       if ($categories['total'] < 1) {
         // do nothing, go through the loop
       } else {
         $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
         break; // we've found the deepest category the customer is in
       }
     }
   } else {
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
   }

   $number_of_categories = tep_db_num_rows($categories_query);

   $rows = 0;
   while ($categories = tep_db_fetch_array($categories_query)) {
     $rows++;
     $cPath_new = tep_get_path($categories['categories_id']);
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
     echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
       echo '              </tr>' . "\n";
       echo '              <tr>' . "\n";
     }
   }

// needed for the new products module shown below
   $new_products_category_id = $current_category_id;
?>
             </TR>
           </TABLE></TD>
         </TR>
         <TR>
           <TD><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></TD>
         </TR>
         <TR>
           <TD><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></TD>
         </TR>
       </TABLE></TD>
     </TR>
     <?php echo CONTENT_BOTTOM_FIRST_TABLE; ?>
   </TABLE>
   <?php echo CONTENT_BOTTOM_FIRST_TD; ?>	
</TD>
<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);

   $column_list = array();
   reset($define_list);
   while (list($key, $value) = each($define_list)) {
     if ($value > 0) $column_list[] = $key;
   }

   $select_column_list = '';

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
         $select_column_list .= 'p.products_model, ';
         break;
       case 'PRODUCT_LIST_NAME':
         $select_column_list .= 'pd.products_name, ';
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $select_column_list .= 'm.manufacturers_name, ';
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $select_column_list .= 'p.products_quantity, ';
         break;
       case 'PRODUCT_LIST_IMAGE':
         $select_column_list .= 'p.products_image, ';
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }

// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
     }
   } else {
// show the products in a given categorie
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;
       }
     }
   } else {
     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);
     $listing_sql .= ' order by ';
     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $listing_sql .= "pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
     }
   }
// Get the category name and description
   $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
       <TD <?php echo CONTENT_PARAM_FIRST_TD; ?>>

      <?php // echo CONTENT_TOP_FIRST_TD; ?>

<TABLE <?php echo CONTENT_PARAM_FIRST_TABLE; ?>>

     <TR>
       <TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
         <TR>
           <td class="pageHeading">
            <?php 
              if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
                echo $category['categories_heading_title'];
              } else {
                echo HEADING_TITLE;
              }
            ?>
           </td>
<?php
// optional Product List Filter
   if (PRODUCT_LIST_FILTER > 0) {
     if (isset($HTTP_GET_VARS['manufacturers_id'])) {
       $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
     } else {
       $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
     }
     $filterlist_query = tep_db_query($filterlist_sql);
     if (tep_db_num_rows($filterlist_query) > 1) {
       echo '            <td align="center" class="main" STYLE="background: url(images/design/w1.jpg) no-repeat right top;">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '<font color=white>' .TEXT_SHOW . '</font> ';
       if (isset($HTTP_GET_VARS['manufacturers_id'])) {
         echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
         $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
       } else {
         echo tep_draw_hidden_field('cPath', $cPath);
         $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
       }
       echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
       while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
       }
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
       echo '</form></td>' . "\n";
     }
   }

// Get the right image for the top-right
   $image = DIR_WS_IMAGES . 'table_background_list.gif';
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['manufacturers_image'];
   } elseif ($current_category_id) {
     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['categories_image'];
   }
?>
         </TR>
<?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  <tr>
           <td align="right" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
  </tr>
  <?php } ?>
       </TABLE></TD>
     </TR>
     <TR>
       <TD><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></TD>
     </TR>
     <TR>
       <TD><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></TD>
     </TR>
     <?php echo CONTENT_BOTTOM_FIRST_TABLE; ?>   
   </TABLE>
   <?php echo CONTENT_BOTTOM_FIRST_TD; ?>	
</TD>
<?php
 } else { // default page
?>
   <TD <?php echo CONTENT_PARAM_FIRST_TD; ?>>

      <?php echo CONTENT_TOP_FIRST_TD; ?>

<TABLE <?php echo CONTENT_PARAM_FIRST_TABLE; ?>>

      <?php echo CONTENT_TOP_FIRST_TABLE; ?>

     <TR>
       <TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
         <TR>
           <TD><?php echo TEXT_MAIN; ?></TD>
         </TR>
         <TR>
           <TD CLASS="main"><?php echo tep_customer_greeting(); ?></TD>
         </TR>
         <TR>
           <TD><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></TD>
         </TR>    
         <TR>
           <TD STYLE="background: url(images/design/bg_center_top2.gif) no-repeat left top;"><BR><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></TD>
         </TR>
<?php
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
       </TABLE></TD>
     </TR>
     <?php echo CONTENT_BOTTOM_FIRST_TABLE; ?>
   </TABLE>
   <?php echo CONTENT_BOTTOM_FIRST_TD; ?>
</TD>
<?php
 }
?>
<!-- body_text_eof //-->

<?php
if (COLUMN_RIGHT_DISPLAY == 'true') {
echo '<!-- right_navigation //-->';
require(DIR_WS_INCLUDES . 'column_right.php');
echo '<!-- right_navigation_eof //-->';
}

require(DIR_WS_INCLUDES . 'footer.php'); 
?>

<?php echo ENDING_TAGS; ?>

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

 

Any Ideas???

Edited by knokenet
Link to comment
Share on other sites

Just installed v1.51, and it looks like I did everything correct.

Database now includes 10 new products to be expired 1.4.2004

 

But...

I don't see them on the main page. I see only the last 10 products added to the catalog.

I'm using a template, so this can be connected somehow.

 

Here's my index.php:

 

 ? ? ? ? ?<TR>
? ? ? ? ? ?<TD STYLE="background: url(images/design/bg_center_top2.gif) no-repeat left top;"><BR><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></TD>
? ? ? ? ?</TR>
<?php
? ?include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
? ? ? ?</TABLE></TD>
? ? ?</TR>
? ? ?<?php echo CONTENT_BOTTOM_FIRST_TABLE; ?>
? ?</TABLE>
? ?<?php echo CONTENT_BOTTOM_FIRST_TD; ?>
</TD>
<?php
?}
?>
<!-- body_text_eof //-->

<?php
if (COLUMN_RIGHT_DISPLAY == 'true') {
echo '<!-- right_navigation //-->';
require(DIR_WS_INCLUDES . 'column_right.php');
echo '<!-- right_navigation_eof //-->';
}

require(DIR_WS_INCLUDES . 'footer.php'); 
?>

<?php echo ENDING_TAGS; ?>

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

 

Any Ideas???

 

This worked for me:

First, you mention an expiration of 1.4.2004 - is that January 4, 2004? If so, it's already expired! Set it to all zeros to never expire or some *future* date :D

 

Second, try changing (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); to (DIR_WS_MODULES . FILENAME_FEATURED); at the end of your index.php file, like so:

 

          <TR>
           <TD STYLE="background: url(images/design/bg_center_top2.gif) no-repeat left top;"><BR><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></TD>
         </TR>
<?php
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
       </TABLE></TD>
     </TR>
     <?php echo CONTENT_BOTTOM_FIRST_TABLE; ?>
   </TABLE>
   <?php echo CONTENT_BOTTOM_FIRST_TD; ?>
</TD>
<?php
 }
?>
<!-- body_text_eof //-->

<?php
if (COLUMN_RIGHT_DISPLAY == 'true') {
echo '<!-- right_navigation //-->';
require(DIR_WS_INCLUDES . 'column_right.php');
echo '<!-- right_navigation_eof //-->';
}

require(DIR_WS_INCLUDES . 'footer.php'); 
?>

<?php echo ENDING_TAGS; ?>

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

Link to comment
Share on other sites

  • 4 months later...
Hi there,

I love this contrib, and had great fun installing it.

However I noticed that the sql statements would not pull out all the featured products from within a category having deep nested sub categories. So I amended the code; I think I changed the parent_id clause to this:

c.categories_id IN (".implode(',',$cat_array).")

And just before declaring the raw sql statement including the above, I put:

function get_all_subcategories($currentParID) {
global $cat_array;
$haschildren = 0; //default
$categories_query = tep_db_query("select c.categories_id, c.parent_id from " . TABLE_CATEGORIES . " c where c.parent_id = '" . $currentParID . "' order by sort_order");
$cat_array[] = $currentParID;
while ($categories = tep_db_fetch_array($categories_query)) ?{
$haschildren=tep_has_category_subcategories($categories['categories_id']);
?if ($haschildren) {
? get_all_subcategories($categories['categories_id']);
?} else {
? $cat_array[] = $categories['categories_id'];
?}
}
}
$cat_array = array();
get_all_subcategories($featured_products_category_id);

Where the above get_all_subcategories function will return an array list of all associated child sub categories pertaining to the current subcategory.

 

I also added in the admin selction the option whether or not to include the specials in the features box.

 

It was my first hack of having to join tables etc, so I haven't posted the entire code of modules/featured.php

 

Would this add featured product under subcategories, and where in the featured.php do I edit to put this code.

Edited by funkyfermin
Link to comment
Share on other sites

  • 2 weeks later...

I installed the contribution featured products 1.5.3. it works fine! now i want to display the featured products from a categorie in the product listing also. not just on the startpage and the nested categorie sites. if i include it in the product_listing file (i use bts, the file is index_products.tpl.php) it doesnt work. can anybody help???

 

thank you

tim

Link to comment
Share on other sites

This solved my problem and I updated the Contributions page. Whoever is the author of this please update the entire archive with the new readme.txt.

 

Step 6:

Add the following lines to /catalog/includes/filenames.php

 

define('FILENAME_FEATURED', 'featured.php');

 

Updated:

 

Step 6:

Add the following lines to /catalog/includes/filenames.php

 

define('FILENAME_FEATURED', 'featured.php');

define('FILENAME_FEATURED_PRODUCTS', 'featured_products.php');

Link to comment
Share on other sites

i installed the mod and get this error;

 

Fatal error: Call to a member function on a non-object in /usr/local/psa/home/vhosts/tblmemory.com/httpdocs/includes/modules/featured.php on line 52

 

 

 

this is line 52 or i can add more if needed;

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));

 

 

the admin side seems to be working fine just when i set to true in admin i recieve the error on front page

Link to comment
Share on other sites

I installed this nice contribution, it works great on the default.php, but in categories, i got many

 

n

n

n

n

n

n

 

And i tried to disable this, but there is no FEATURED_PRODUCTS_DISPLAY in my /catalog/includes/configure.php :( so there is no way i can set the value to false.

 

 

Please help. Thank you.

Link to comment
Share on other sites

I installed this nice contribution, it works great on the default.php, but in categories, i got many

 

n

n

n

n

n

n

 

And i tried to disable this, but there is no FEATURED_PRODUCTS_DISPLAY in my /catalog/includes/configure.php :( so there is no way i can set the value to false.

 

 

Please help. Thank you.

ISSUE:

Display shows the 'n' character in index page when categories are selected.

 

You have edited the index.php using the online file manager which has removed the \ backslashes from the code, this is a known issue with using the file manager to edit files, it is better to use an ftp program such as ws_ftp to download the file and edit it locally then ftp back to the server.

 

FIX:

To fix this issue you will need to find the 4 instances of "n"; on your index.php and change them to "\n";

 

around line #104 look for this code

while ($categories = tep_db_fetch_array($categories_query)) { 
     $rows++; 
     $cPath_new = tep_get_path($categories['categories_id']); 
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; 
     echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "n"; 
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { 
       echo '              </tr>' . "n"; 
       echo '              <tr>' . "n"; 
     } 
   }

change to this

while ($categories = tep_db_fetch_array($categories_query)) { 
     $rows++; 
     $cPath_new = tep_get_path($categories['categories_id']); 
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; 
     echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; 
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { 
       echo '              </tr>' . "\n"; 
       echo '              <tr>' . "\n"; 
     } 
   }

and then around line #256 look for this code

while ($filterlist = tep_db_fetch_array($filterlist_query)) { 
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); 
       } 
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); 
       echo '</form></td>' . "n"; 
     } 
   }

and change to this

while ($filterlist = tep_db_fetch_array($filterlist_query)) { 
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); 
       } 
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); 
       echo '</form></td>' . "\n"; 
     } 
   }

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I am getting this error: can someone help

 

Warning: main(includes/modules/FILENAME_FEATURED): failed to open stream: No such file or directory in /var/www/html/osc/index.php on line 313

 

Warning: main(): Failed opening 'includes/modules/FILENAME_FEATURED' for inclusion (include_path='.:/usr/lib/php/:/usr/share/pear/') in /var/www/html/osc/index.php on line 313

 

I have STS installed could that be the problem. How do i fix the problem?

 

Thanks!!

Link to comment
Share on other sites

  • 3 weeks later...

How do I disable this contrib? This is how the readme says to do it.

 

--

HOW TO UNINSTALL

---

 

* To disable this contribution, all you would need to do is set the value of

FEATURED_PRODUCTS_DISPLAY in /catalog/includes/configure.php to false.

This module will automatically display the "New Products for <month>"

infobox if featured products is disabled in the configure.php

 

But, I do not see "FEATURED_PRODUCTS_DISPLAY" anywhere in my configure.php.

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

I am trying to install this Contrib and there is some code that I do not see. The instructions say;

 

Step 5:
Add the following line to /catalog/admin/includes/boxes/catalog.php, right before the line that contains <a href="'. tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');

'<a href="' . tep_href_link(FILENAME_FEATURED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_FEATURED_PRODUCTS . '</a><br>' .

 

However, when I go to my catalog.php this is all I have.

 

<?php
/*
 $Id: catalog.php,v 1.20 2002/03/16 00:20:11 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- catalog //-->
         <tr>
           <td>
<?php
 $heading = array();
 $contents = array();

 $heading[] = array('text'  => BOX_HEADING_CATALOG,
                    'link'  => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=catalog'));

 if ($selected_box == 'catalog') {
   $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_CATEGORIES, BOX_CATALOG_CATEGORIES_PRODUCTS) .
                                  tep_admin_files_boxes(FILENAME_SPECIALS, BOX_CATALOG_SPECIALS) .
                                  tep_admin_files_boxes(FILENAME_PRODUCTS_EXPECTED, BOX_CATALOG_PRODUCTS_EXPECTED) .
                                  tep_admin_files_boxes(FILENAME_PRODUCTS_ATTRIBUTES, BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES) .
                                  tep_admin_files_boxes(FILENAME_MANUFACTURERS, BOX_CATALOG_MANUFACTURERS) .
                                  tep_admin_files_boxes(FILENAME_REVIEWS, BOX_CATALOG_REVIEWS));
 }

 $box = new box;
 echo $box->menuBox($heading, $contents);
?>
           </td>
         </tr>
<!-- catalog_eof //-->

 

Where would I add this code? I'm stuck on this part and don't know really what I should do. Any suggestions?

Link to comment
Share on other sites

I am not getting the following error on my page. Can anyone help me.

 

Warning: main(includes/modules/FILENAME_FEATURED): failed to open stream: No such file or directory in c:\hosting\webhost4life\member\unlimited\catalog\index.php on line 312

Warning: main(): Failed opening 'includes/modules/FILENAME_FEATURED' for inclusion (include_path='.;c:\php4\pear') in c:\hosting\webhost4life\member\unlimited\catalog\index.php on line 312

Link to comment
Share on other sites

  • 7 months later...

My featured products contribution works great, however, an empty featured products box is shown for categories that don't have any designated featured products. Additionally, top categories (with subcategories with assigned featured items) also show empty featured products box. Is there any way to call on the featured products module only for categories that actually have items featured from the admin?

 

You can view the problem here

 

Thanks.

Link to comment
Share on other sites

  • 8 months later...

I have installed the latest version of this (1.5.9) and it seems to work ok,

 

However I have a couple of small issues that I hope someone can help with.

 

In Catagories page the module is displayed twice and module is diplayed on catagories which have no featured products

http://get-wireless.co.uk/dev/bluetooth-c-44.html <-no Featured Products

 

http://get-wireless.co.uk/dev/flash-memory-c-57.html <-- Featured Products

 

Also I can seem to get graphical borders to work properly with it. I seems to wrap the right column up as well.

 

Regards

Shaun

Link to comment
Share on other sites

I have installed the latest version of this (1.5.9) and it seems to work ok,

 

However I have a couple of small issues that I hope someone can help with.

 

In Catagories page the module is displayed twice and module is diplayed on catagories which have no featured products

http://get-wireless.co.uk/dev/bluetooth-c-44.html <-no Featured Products

 

http://get-wireless.co.uk/dev/flash-memory-c-57.html <-- Featured Products

 

Also I can seem to get graphical borders to work properly with it. I seems to wrap the right column up as well.

 

Regards

Shaun

 

 

Hi

 

In file

 

catalog/index.php

 

about line 350 must have this code to display the "New products on month.." module:

 

		  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

 

is possible you hace instead this the code to display the featured products duplicate:

 

	<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td>
</tr>

 

only need one and restore the new products module:

 

	<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>

 

 

If you want to display the featured products with individual boxes I upload a version of instructios to integrate both

Link to comment
Share on other sites

Link to comment
Share on other sites

Hi All,

 

I was looking for some advice, i have installed this fine and it it works on all pages except my index.php page.

 

My store is very heavily modified and many moons ago i did something to stop 'new products for...' appearing on my index page. I have previously been using 'Wolfen featured sets' for this featured product purpose, but as this contribution is compatible with the 'graphical infoboxes' contribution i thought i would give it ago.

 

I really can't for the life of me remember how i disabled the new products module, so any suggestions would be most appreciated. I would post some code, but seen as i am at a total loss i wouldn't know what code to start with. Suggestions please?

 

Thanks in advance.

 

Donna

Link to comment
Share on other sites

Hi All,

 

I was looking for some advice, i have installed this fine and it it works on all pages except my index.php page.

 

My store is very heavily modified and many moons ago i did something to stop 'new products for...' appearing on my index page. I have previously been using 'Wolfen featured sets' for this featured product purpose, but as this contribution is compatible with the 'graphical infoboxes' contribution i thought i would give it ago.

 

I really can't for the life of me remember how i disabled the new products module, so any suggestions would be most appreciated. I would post some code, but seen as i am at a total loss i wouldn't know what code to start with. Suggestions please?

 

Thanks in advance.

 

Donna

 

 

Hi

 

The line of code where appear the New Products on month.. is about 312 for a clean install of osCommerce

 

in a clean install this is the code near about lines 286 - 323:

 

	<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="main"><?php echo tep_customer_greeting(); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
	</table></td>
  </tr>
</table></td>
<?php
 }
?>

 

 

you have to insert the code of Featured Products in this location:

 

<td class="main"><?php echo TEXT_MAIN; ?></td>

</tr>

<-- HERE

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

</tr>

 

 

but its could be different in your code

 

 

 

regards

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

I've installed Featured Products V1.5.8 . it works fine but it did not shown on the first page like those new products.

 

I've read the install text again but have no clue. Appreciate if someone may help.

 

I'm using STS 4.4 too but the install text point 15 in Featured Products did not work. the osc is broken.

 

15.2 Add the following lines to /catalog/includes/column_right.php or column_left.php

 

require(DIR_WS_BOXES . 'featured.php');

 

// STS: ADD

$sts_block_name = 'featuredbox';

require(STS_RESTART_CAPTURE);

// STS: EOADD

 

I remove

 

// STS: ADD

$sts_block_name = 'featuredbox';

require(STS_RESTART_CAPTURE);

// STS: EOADD

 

it works fine.

 

I've also followed the instruction of Featured Products 1.5.9 contribution with STS 4.3.3. Is it o.k without adding the above code then ?

 

regards

jason

Link to comment
Share on other sites

Ok, I have Featured Products installed. No Errors at all. Beautiful contrib. ty!

 

Request:

Can someone help me or PM me the code changes to add a BUY NOW button to each product?, or make the changes in the code and post it here ?

I am sure many would like to add this.

 

Any help is appreciated.

 

 

 

Please, can you help me !!!

I installed products fertured 1.58 and take this error on catalog/admin/featured.php

 

Featured Products

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from products p, featured s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

 

[TEP STOP]

I HOPE THAT SOMEONE CAN HELP ME !!! THANKS IN ADVANCE

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...