Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing Enhancements, Thumbnails & Manufacturer Headings


spooks

Recommended Posts

Hello, thanks for this contribution. I first installed v1.5b but changed to V1.6.

It's working all right but manufacturer description isn't shown though I set 'Product Listing Manufacturers Description True' in admin.

 

There's a text in 'manufacturers description' column of 'manufacturers_info' table.

I can insert and update it via admin panel.

 

One thing I didn't do as the installation of this module is includes/boxes/manufacturers.php

because I had changed the file as below already. Am I having trouble because of it?

 

Any help or suggestions is greatly appreciated.

 

Regards,

aki

 

<?php
 $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
 if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
?>
<!-- manufacturers //-->
         <tr>
           <td class="pb20">
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);

   new infoBoxHeading($info_box_contents, false, false);
// Display a list
     $manufacturers_list = '';
     while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
       $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
       if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<span class="TextHighlight"><b>' . $manufacturers_name .'</b></span>';
       $manufacturers_list .= '<p><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a></p>'; 
     }
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $manufacturers_list);
   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<?php
 }
?>

Link to comment
Share on other sites

As long as 'Product Listing Manufacturers Description' is set to true the description will be displayed in the headings in manufacturer list mode, it is not currently displayed in other display modes.

 

I can only assume you have not selected a manufacturer list mode, as I cannot see any reason this would not work otherwise.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Download is not working from the Contributions page...

 

 

Its fine for me, keep trying.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Not surprising, as its not there!!!

 

http://addons.oscommerce.com/info/6051

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sam,

 

Excellant Contrib !

 

Is there a way to have the sort pull down and the Results / Page to show up at the TOP of the thumbnails page, above the controls for << prev and next >> .

 

Just wondering ? :D

 

Thanks !

Link to comment
Share on other sites

to have the sort pull down and the Results / Page to show up at the TOP of the thumbnails page, above the controls for << prev and next >> .

 

find in product_listing.php:

 

// sort order array
if ($_GET['sort'] == '0d') $sort_array[] = array('id' => 0 . 'd', 'text' => 'Date Added');
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
$sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MODEL);
	  break;
	case 'PRODUCT_LIST_NAME':
	  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRODUCTS);
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MANUFACTURER);
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_QUANTITY);
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_WEIGHT);
	  break;
case 'PRODUCT_LIST_PRICE':
  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRICE);
	  break; 
  }
}
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
$sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MODEL . ' Descending');
	  break;
	case 'PRODUCT_LIST_NAME':
	  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRODUCTS . ' Descending');
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MANUFACTURER . ' Descending');
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_QUANTITY . ' Descending');
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_WEIGHT . ' Descending');
	  break;
case 'PRODUCT_LIST_PRICE':
  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRICE . ' Descending');
	  break; 
  }
} 
// Max Results Array  
for ($i=1, $n=10; $i<$n; $i++) {  
 $max_display[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS * $i, 'text' => MAX_DISPLAY_SEARCH_RESULTS * $i); 
 } 
 $max_display[] = array('id' => 1000000, 'text' => 'Show All');
// store GET vars  
$get_vars = '';
reset($_GET);
while (list($key, $value) = each($_GET)) {
  if ( ($key != 'sort') && ($key != 'max') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	$get_vars .= tep_draw_hidden_field($key, $value);
  }
}

 

and move to before (near top)

 

if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nProduct Listing Setup File.'; print "<script>alert('$to');</script>"; }

 

then find:

 

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="smallText">Results/Page: <?php echo tep_draw_form('maxdisplay', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . tep_draw_pull_down_menu('max', $max_display, $_GET['max'], 'onChange="this.form.submit();"') . $get_vars . (isset($_GET['sort']) ? tep_draw_hidden_field('sort', $_GET['sort']) : '') .  tep_hide_session_id().'</form>';  ?></td>
<td class="smallText" align="right">Sort Order: <?php echo tep_draw_form('sorting', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . tep_draw_pull_down_menu('sort', $sort_array, $_GET['sort'], 'onChange="this.form.submit();"') . $get_vars . (isset($_GET['max']) ? tep_draw_hidden_field('max', $_GET['max']) : '') . tep_hide_session_id().'</form>';  ?></td>
 </tr>
</table>
<?php

 

and move to just after:

 

if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nProduct Listing Setup File.'; print "<script>alert('$to');</script>"; }

 

 

should work, not tested..

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sam,

thanks for contribution!

 

I have a question, or probably even something to think about:

 

I set in settings 2 products per row.

When I open page it shows 9 items, the last row has only one item, so place for last item is empty and it doesn't look good.

Is it possible to show only complete rows? In my case it should show 4 complete rows or 10 items (not 9) for 5 complete rows.

 

Thanks!

Computers777dotcom

Link to comment
Share on other sites

Sam,

thanks for contribution!

 

I have a question, or probably even something to think about:

 

I set in settings 2 products per row.

When I open page it shows 9 items, the last row has only one item, so place for last item is empty and it doesn't look good.

Is it possible to show only complete rows? In my case it should show 4 complete rows or 10 items (not 9) for 5 complete rows.

 

Thanks!

 

go to your admin/maximum values and change the "Product listing" from 9 to 10 or whatever you want. :)

Link to comment
Share on other sites

I have some issue with you contribution., perhaps you can help me.

 

From the new products page I have several products from several manufacturers. The Cpath is not defined and manufacturer_id is not defined so I guess you realize, it does not show the products when I switch from thumbnail view to list view.

It shows the manufacturers names (all of them even if there are products from only 2 of manaufacturers) but no product.

 

Can you help me with this issue?

Link to comment
Share on other sites

I have some issue with you contribution., perhaps you can help me.

 

From the new products page I have several products from several manufacturers. The Cpath is not defined and manufacturer_id is not defined so I guess you realize, it does not show the products when I switch from thumbnail view to list view.

It shows the manufacturers names (all of them even if there are products from only 2 of manaufacturers) but no product.

 

Can you help me with this issue?

 

 

I havent seen the issue your getting, in products_new.php or new_products.php manufacturer or cpath are not set in the $_GET, even in the original files, as no need.

 

If you switch products_new.php to list mode you are getting the original code, its only modified for thumbnails.

 

In product_listing.php I don`t include the cpath, for a very good reason (Google).

 

 

If you put up a url I`ll take a look, do you have a template?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I do switch from products_new.php.

 

 

The query is set up in products_new.php, so thats where any error would occur, there's no point posting me a copy of my own code!!

 

But I`ve not seen problem, so unless your describing it wrong perhaps there is an issue with your install. I cant fix what I cant see.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

The query is set up in products_new.php, so thats where any error would occur, there's no point posting me a copy of my own code!!

 

But I`ve not seen problem, so unless your describing it wrong perhaps there is an issue with your install. I cant fix what I cant see.

 

 

I have included the products_new.php code as well. I am using several add-ons, so I believe it is not entirely your own code.

Let me describe it again:

 

When I switch from thumbnails view to list view from the products_new.php page, all I get is the manufacturers names (all of them, even if the products are not from all manufacturers), the number of products, the number of pages but there is no product on the page.

When I switch to list view when viewing products from a category or by manufacturer, it all goes well.

 

<?php
/*
 $Id: products_new.php 1739 2007-12-20 00:52:16Z hpdl $
 modified for thumbnail view 2007-07-24
 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');
 $HTTP_GET_VARS['manufacturers_id'] = '';
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<table border="0" width="732" cellspacing="0" cellpadding="0" bgcolor="#333333" style="padding-bottom:3px; ">
 <tr>
 	<td align="center">
<!-- body //-->
<table border="0" width="716" cellspacing="0" cellpadding="0">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top" style="padding:0px 5px; "><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 $info_box_contents = array();
   $info_box_contents[] = array('text' => HEADING_TITLE); new infoBoxHeading1($info_box_contents, true, true, false);?></td>

         </tr>
       </table></td>
     </tr>
  <tr>
       <td class="infoBox1" height="399"><table border="0" width="100%" cellspacing="0" cellpadding="0" >
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
     </tr>
<?php
 $products_new_array = array();
$date = strtotime("-1000 days"); // set max age of displayed product
$date = strftime("%Y-%m-%d",$date); 
 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name desc ";
if (strstr(PRODUCT_THUMBNAIL_VIEW, 'thumbnails')) {
		$listing_sql = $products_new_query_raw;
		$define_list = array('PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        	'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
               		  'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE);
   asort($define_list);
   $column_list = array();
   reset($define_list);
   while (list($key, $value) = each($define_list)) {
     if ($value > 0) $column_list[] = $key;
   } ?>
		<tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>
<?php } else {

$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_NEW_PRODUCTS);
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="2" cellpadding="2">
<?php
 if ($products_new_split->number_of_rows > 0) {
   $products_new_query = tep_db_query($products_new_split->sql_query);
	//$products_new_query = tep_db_query($products_new_query_raw);
   while ($products_new = tep_db_fetch_array($products_new_query)) {
     if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
       $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
     } else {
       $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
     }
?>
         <tr>
           <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '" >' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
           <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '" class="categories"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
           <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
         </tr>
         <tr>
           <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '4'); ?></td>
         </tr>
<?php
   }
 } else {
?>
         <tr>
           <td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
<?php
 }
?>
       </table></td>
     </tr>
<?php
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 }   }
?>
</table></td></tr><tr>
		<td><?php  new infoBoxFooter(''); ?></td>
	</tr>
   </table></td>
<!-- body_text_eof 
   <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="0">
<!-- right_navigation 
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof 
   </table></td>
 </tr>
 //-->
</table>
</td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

try with this version of products_new.php

 

 

<?php
/*
 $Id: products_new.php 1739 2007-12-20 00:52:16Z hpdl $
 modified for thumbnail view 2007-07-24
 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com/"]http://www.oscommerce.com[/url]

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
require('includes/application_top.php');
 $HTTP_GET_VARS['manufacturers_id'] = '';
unset($HTTP_GET_VARS['manufacturers_id'];
unset($_GET['manufacturers_id'];
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

?>
<!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">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<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_products_new.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>
<?php
 $products_new_array = array();
$date = strtotime("-1000 days"); 
$date = strftime("%Y-%m-%d",$date); 
 $define_list = array('PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
asort($define_list);
$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
} 
  $sort_sql='';
if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

	  $_GET['sort'] = 0 . 'd';
	  $sort_sql = " order by p.products_date_added DESC, pd.products_name";

} else {
  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
  $sort_order = substr($HTTP_GET_VARS['sort'], 1);

  switch ($column_list[$sort_col-1]) {
	 case 'PRODUCT_LIST_NAME':
	  $sort_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $sort_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_PRICE':
	  $sort_sql .= " order by p.products_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
  }
}

 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'" . $sort_sql;
if (strstr(PRODUCT_THUMBNAIL_VIEW, 'thumbnails')) {
  $listing_sql = $products_new_query_raw;
 ?>
  <tr>
	<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
  </tr>
<?php } else {
$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_NEW_PRODUCTS);
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ($products_new_split->number_of_rows > 0) {
$products_new_query = tep_db_query($products_new_split->sql_query);
 //$products_new_query = tep_db_query($products_new_query_raw);
while ($products_new = tep_db_fetch_array($products_new_query)) {
  if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
	$products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
  }
?>
	  <tr>
		<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
		<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
		<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
}
 } else {
?>
	  <tr>
		<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
 }
?>
	</table></td>
  </tr>
<?php
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table></td>
  </tr>
<?php
 }   }
?>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Well, I just got it figured out. You forgot to add, to the sql query in products _new.php, the manufacturers_id and products_special_price.

That is why no products where diplayed and also I did not get the special price diplayed, but got it figured out a few days ago.

Link to comment
Share on other sites

try with this version of products_new.php

 

I think you should update the contribution presently available for download and include the fix for 2 bugs:

 

1. manufacturers_id from products_new.php in the sql query

 

2. You are calling $listing['specials_new_products_price'] in product_listing.php but also you do not have it in the database query, therefor the special price will not be dispalyed.

 

I resolved the issue myself but I am not a php guru and my code is not that good.

Link to comment
Share on other sites

Well, I just got it figured out. You forgot to add, to the sql query in products _new.php, the manufacturers_id and products_special_price.

That is why no products where diplayed and also I did not get the special price diplayed, but got it figured out a few days ago.

 

If you figured this out a few days ago, why were you asking today??

 

The query used is largly that from the original file, thats why manufacturers_id was'nt there, its only needed if someone clicks on the manufacturer link in the listing anyway.

 

products_special_price was never part of products _new as it was obvoiusly expected that new products wont have them.

 

In both cases this would'nt stop a product listing being displayed, one adds an extra price the other a link, nothing more.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

If you figured this out a few days ago, why were you asking today??

 

The query used is largly that from the original file, thats why manufacturers_id was'nt there, its only needed if someone clicks on the manufacturer link in the listing anyway.

 

products_special_price was never part of products _new as it was obvoiusly expected that new products wont have them.

 

In both cases this would'nt stop a product listing being displayed, one adds an extra price the other a link, nothing more.

 

I figured out the special_price problem, not the manufacturer problem. I got to the manufactuer problem today.

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...