Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing in Columns v2.0


djmonkey1

Recommended Posts

For the horizontal line, I don't know. You'd have to add in extra code for that, maybe a whole new table? You could add it in at the bottom of each listing, but it wouldn't go across the whole table (as you've seen). It might be simple, but it might be really complex. Maybe CSS? I know you could add a border around every table cell, but that's not what you're looking for. Theoretcially you should be able to set "border-bottom" but I've tried that before and it didn't work, however I may have done it wrong. CSS can be like PHP, one wrong move and you're road kill.

 

As for sorting, it's not supposed to sort. The default sort should be A-Z. Maybe your items are actually being sorted by price? That custom sort order contribution looks cool, I may try that out in my store. Maybe even roll it into this contribution.

 

Adding the ability to have the customer sort the products is on the "To Do" list. Unfortunately I have a real job....

 

Gotta go, U2 beckons....

do you have any recommendations for what to try and add to the css file, and under what label? i tried playing with it just a bit... and seeing what came up... and couldnt get it even to do lines around everything...... where did you put the border-bottom code?

 

what if i just wanted to have something like having each row be its own table....... i bet that would work for the lines...... say like

<table>

<tr>

<td>product1</td>

<td>product2</td>

<td>prodcut3</td>

</tr></table>

<table>

<tr>

<td><img src=..... code for horiztontal line...></td>

</tr></table>

<table>

<td>product4</td>

<td>product5</td>

<td>prodcut6</td>

.

.

.

.

.

 

is something like that possible?????

Link to comment
Share on other sites

  • Replies 456
  • Created
  • Last Reply

Top Posters In This Topic

do you have any recommendations for what to try and add to the css file, and under what label? i tried playing with it just a bit... and seeing what came up... and couldnt get it even to do lines around everything...... where did you put the border-bottom code?

 

what if i just wanted to have something like having each row be its own table....... i bet that would work for the lines...... say like

<table>

<tr>

<td>product1</td>

<td>product2</td>

<td>prodcut3</td>

</tr></table>

<table>

<tr>

<td><img src=..... code for horiztontal line...></td>

</tr></table>

<table>

<td>product4</td>

<td>product5</td>

<td>prodcut6</td>

.

.

.

.

.

 

is something like that possible?????

 

sorry for the double reply... i could not find the edit.... anyways.......

 

i tried adding some code to the product_listing_col.php file..... look at what happened ( it is almost what I wanted... I understand why it happened.... but i do not know how to do what i want....

 

check out http://carpenoctem.tv/catalog/index.php?cPath=36_47_49

 

it put a horizontal line after each item.... instead of each 3...... any suggestions on what to change?

 

here is the code that i did for the $lc_text variable

 

$lc_text= '<a class="boxText" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_model'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a class="boxText" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_model'] . '</a><br></td></tr></table><table width=100%><tr><td><hr></td></tr></table><table>';

 

 

let me know if you have any ideas.... I am open to anything .....

 

Thanks

 

mark

Link to comment
Share on other sites

This is strange: I just installed this contrib to another store and now its giving me double buy now buttons, and if i turn the quanity filed on it gives me double of those as well. This store is almost identical to the other except it has the product sort contrib installed.

 

I went back and checked the edits twice to see if I missed anything, but it all looks right :\ I don't knwo what's up here....

 

EDIT:

 

hmmm....if I trun of the buy now buttons, then it shows doubles of the price; if I turn off the price it show doubles of the title; so what ever is displayed last is doubled, any ideas?

Edited by jeffy777
Link to comment
Share on other sites

Alright since you asked, here is the code from index.php where I'm guessing the problem is. All the edits for the sort order contrib are marker with "//sort order" accordingly.....

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

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

 Copyright (c) 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);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2
?>
<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 //-->
<?php
 if ($category_depth == 'nested') {
// BEGIN CATEGORIES DESCRIPTION MOD - ADDED TO QUERY: cd.categories_heading_title, cd.categories_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 = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
// END CATEGORIES DESCRIPTION MOD
$category = tep_db_fetch_array($category_query);
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><br><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>

		<td class="pageHeading" align="left" width="25%"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

<!-- // BEGIN CATEGORIES DESCRIPTION MOD - REPLACED COMMENTED CODE -->
<!--			<td class="pageHeading"><?php echo HEADING_TITLE; ?></td> -->
		<td align="middle" width="75%">
		 <?php 

		   if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_name'])) ) {
			 echo "<font size=6 color=#866FBA>" . $category['categories_name'] . "</font>";
		   }

		   if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
			 echo "<br><font size=4 color=#B3B3BF><i>" . $category['categories_heading_title'] . "</i></font>";
		   }
		 ?>
		</td>
<!-- // END CATEGORIES DESCRIPTION MOD - REPLACED COMMENTED CODE -->
	  </tr>
	</table></br></td>
  </tr>
<!-- // BEGIN CATEGORIES DESCRIPTION MOD -->
  <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  <tr>
		<td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
  </tr>
  <?php } ?>
<!-- // END CATEGORIES DESCRIPTION MOD -->
  <tr>
	<td><br><?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) . '">' . 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";
  }
}

// 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>
</table></td>
<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list

//sort order
//	$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

$define_list = array('PRODUCT_LIST_SORT_ORDER' => PRODUCT_LIST_SORT_ORDER,
					 'PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
//end sort order
					 '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,
					  //bof column product listing with attributes
					 'PRODUCT_LIST_MULTIPLE' => PRODUCT_LIST_MULTIPLE,
					 'PRODUCT_LIST_BUY_NOW_MULTIPLE' => PRODUCT_LIST_BUY_NOW_MULTIPLE,
					 //eof column product listing with attributes
					 '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++) {
  if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {
	continue;
  }
  switch ($column_list[$i]) {
//sort order
	case 'PRODUCT_LIST_SORT_ORDER':
	  $select_column_list .= 'p.products_sort_order, ';
	  break;
//end sort order
	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++) {
//sort order
//		if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
//		  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
//		  $listing_sql .= " order by pd.products_name";
	if ($column_list[$i] == 'PRODUCT_LIST_SORT_ORDER') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by p.products_sort_order, pd.products_name";

	  break;
	}
	elseif ($column_list[$i] == 'PRODUCT_LIST_NAME' && PRODUCT_LIST_SORT_ORDER==0) {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
//end sort order
	  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]) {
//sort order
	case 'PRODUCT_LIST_SORT_ORDER':
	  $listing_sql .= "p.products_sort_order , pd.products_name " . ($sort_order == 'a' ? 'asc' : '');
	  break;
//end sort order
	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;
  }
}

// BEGIN CATEGORIES DESCRIPTION MOD
// 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);
// END CATEGORIES DESCRIPTION MOD

?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><br><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>

<?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">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
	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'];
}
?>
		<td align="left" width="25%"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

<!-- // BEGIN CATEGORIES DESCRIPTION MOD - REPLACED COMMENTED CODE -->
		<!-- <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> -->

		<td align="middle" width="75%">
		 <?php 

		   if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_name'])) ) {
			 echo "<font size=6 color=#866FBA>" . $category['categories_name'] . "</font>";
		   }

		   if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
			 echo "<br><font size=4 color=#B3B3BF><i>" . $category['categories_heading_title'] . "</i></font>";
		   }
		 ?>
		</td>

<!-- // END CATEGORIES DESCRIPTION MOD - REPLACED COMMENTED CODE -->

	  </tr>

<!-- // BEGIN CATEGORIES DESCRIPTION MOD -->
  <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  <tr>
		<td align="left" colspan="2" class="category_desc"><br><?php echo $category['categories_description']; ?></td>
  </tr>
  <?php } ?>
<!-- // END CATEGORIES DESCRIPTION MOD -->

	</table></td>
  </tr>
  <tr>
	<td><br><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
  </tr>
</table></td>
<?php
 } else { // default page
?>
<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 echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_MAIN_CATEGORIES); ?></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
 }
?>
<!-- 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'); ?>

 

Thanks for any help you can offer!

Edited by jeffy777
Link to comment
Share on other sites

Do you mean product_listing_col.php that is used instead for this contrib?

 

<?php
/*
original: $Id: product_listing.php,v 1.44 2003/06/09 22:49:43 hpdl Exp $

corrected for proper HTML 2005/07/10 JanZ
merged and updated by djmonkey1 with indispensable assistance by JanZ 2005/10/05
v2.1 developed by djmonkey1 with indispensable assistance by the Mighty JanZ  2005/10/09
reverted to  a non-SPPC state by djmonkey1

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

*/
//bof product listing with attributes
 $list_box_contents = array();
 $list_box_contents[] = array('params' => 'class="productListing-heading"');
 $cur_row = sizeof($list_box_contents) - 1;

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
  case 'PRODUCT_LIST_MULTIPLE':
	$add_multiple = "1";
	echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_multiple', 'NONSSL') . '">';
	break;

	}}
//eof product listing with attributes
?>
<?php
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>  <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
 <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}

$list_box_contents = array();

if ($listing_split->number_of_rows > 0) {
 $row = 0;
 //$rows = 0;
 $column = 0;
 $listing_query = tep_db_query($listing_split->sql_query);
while ($listing = tep_db_fetch_array($listing_query)) {

// WARNING the code assumes there are three products per row. To use a different number change the number
// at line 195: if ($column >= 3) and the code to fill up the table row below that accordingly
// $counter = $row;
// $class_for_buy_now = 'class="productListing-odd"';
// $list_box_contents[$row] = array('params' => 'class="productListing-odd"');

 $rows++;

if (($rows/2) == floor($rows/2) && ($row > $counter)) {
  $list_box_contents[$row] = array('params' => 'class="productListing-even"');
  $class_for_buy_now = 'class="productListing-even"';
  $counter = $row;
} else {
 if ($row > $counter) {
  $list_box_contents[$row] = array('params' => 'class="productListing-odd"');
  $class_for_buy_now = 'class="productListing-odd"';
  $counter = $row;
 }
}

$product_contents = array();

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
  $lc_align = '';

  switch ($column_list[$col]) {
	case 'PRODUCT_LIST_MODEL':
	  $lc_align = '';
	  $lc_text = ' ' . $listing['products_model'] . ' ';
		break;
	  case 'PRODUCT_LIST_NAME':
		$lc_align = '';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
		}
		break;
	  case 'PRODUCT_LIST_MANUFACTURER':
		$lc_align = '';
		$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
		break;
	  case 'PRODUCT_LIST_PRICE':
		$lc_align = 'right';
		if (tep_not_null($listing['specials_new_products_price'])) {
		  $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
		} else {
		  $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
		}
		break;
	  case 'PRODUCT_LIST_QUANTITY':
		$lc_align = 'right';
		$lc_text = ' ' . $listing['products_quantity'] . ' ';
		break;
	  case 'PRODUCT_LIST_WEIGHT':
		$lc_align = 'right';
		$lc_text = ' ' . $listing['products_weight'] . ' ';
		break;
	  case 'PRODUCT_LIST_IMAGE':
		$lc_align = 'center';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
		}
		break;
	//bof product listing with attributes
	 case 'PRODUCT_LIST_BUY_NOW':
	   $lc_align = 'center';
	  $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
	  break;
	  // Begin Buy Now button with attributes and quantity mod 
	  // Begin Add Multiple  with attributes Contrib
	  case 'PRODUCT_LIST_MULTIPLE': 
		$lc_align = 'right'; 
		$lc_valign = 'top'; 
		$lc_text = (TABLE_HEADING_MULTIPLE . tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"'));
		$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . $listing['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'");
		$product_info = tep_db_fetch_array($product_info_query);
		$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
		$products_attributes = tep_db_fetch_array($products_attributes_query);
		if ($products_attributes['total'] > 0) {
		$lc_text .= '<table border="0" cellpadding="0" cellspacing"0">';
		$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
		while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
		$selected = 0;
		$products_options_array = array();
		$lc_text .= '<tr><td class="main">' . $products_options_name['products_options_name'] . ':</td><td>' . "\n";
		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $listing['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
		while ($products_options = tep_db_fetch_array($products_options_query)) {
		$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
		if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	}
	//$lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]);
	//$lc_text .= tep_draw_pull_down_menu('id_'.$listing[$x]['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);
	$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]);
	//$lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); 
	$lc_text .= '</td></tr>';
  }
  $lc_text .= '</table>';
}
		break;			
		case 'PRODUCT_LIST_BUY_NOW_MULTIPLE': 
		 $lc_align = 'right'; 
		$lc_valign = 'top'; 
		$lc_text = '<form name="buy_now_' . $listing['products_id'] . '" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now_form', 'NONSSL') . '">';
		$lc_text .= (TABLE_HEADING_MULTIPLE) . '<input type="text" name="cart_quantity" value="1" maxlength="6" size="4">'; 
		$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . $listing['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'"); 
		$product_info = tep_db_fetch_array($product_info_query); 
		$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); 
		$products_attributes = tep_db_fetch_array($products_attributes_query); 
		if ($products_attributes['total'] > 0) { 
		$lc_text .= '<table border="0" cellpadding="0" cellspacing"0">'; 
		$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); 
		while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { 
		$selected = 0; 
		$products_options_array = array(); 
		$lc_text .= '<tr><td class="main">' . $products_options_name['products_options_name'] . ':</td><td>' . "\n"; 
		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $listing['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); 
		while ($products_options = tep_db_fetch_array($products_options_query)) { 
		$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); 
		if ($products_options['options_values_price'] != '0') { 
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; 
	  } 
	} 
	$lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); 
	//$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]);
	$lc_text .= '</td></tr>'; 
  } 
  $lc_text .= '</table>'; 
  $lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW);

   }
  if ($products_attributes['total'] == 0) { 
	$lc_text .= '<br> ';
	$lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW);
 $lc_text .= '<br> ';
 $lc_text .= '<table border="0" cellpadding="0" cellspacing"0"><tr><td class="main"></td><td></td></tr></table>';
		 }
  $lc_text .= '</form>'; 
		break; 
// End Add Multiple mod
  }
  $product_contents[] = $lc_text;

}
$lc_text = implode('<br>', $product_contents);
$list_box_contents[$row][$column] = array('align' => 'center',
											//bof product listing with attributes
											'valign' => $lc_valign,
											//eof product listing with attributes
										  'params' => 'class="productListing-data"',
										  'text'  => $lc_text);
$column ++;
if ($x == ($no_of_listings -1)) {
 // fill up the remainder of the table row with empty cells, assumes three products per row!
 if ($column == '1') {
$list_box_contents[$row][$column + 1] = array('align' => 'center',
											//bof product listing with attributes
											'valign' => $lc_valign,
											//eof product listing with attributes
										  'params' => 'class="productListing-data"',
										  'text'  => " ");
	   $column ++;
 }
 if ($column == '2') {
$list_box_contents[$row][$column + 1] = array('align' => 'center',
											//bof product listing with attributes
											'valign' => $lc_valign,
											//eof product listing with attributes
										  'params' => 'class="productListing-data"',
										  'text'  => " ");
 }	  
}
if ($column >= 3 || $x == ($no_of_listings -1) ) {
 $row ++; // we start a new tr here  with $list_box_contents
  $list_box_contents[$row] = array('params' => $class_for_buy_now);
  $column = 0;
	 }
 } // end for ($x = 0; $x < $no_of_listings; $x++)

 new productListingBox($list_box_contents);
} else {
 $list_box_contents = array();

 $list_box_contents[0] = array('params' => 'class="productListing-odd"');
 $list_box_contents[0][] = array('params' => 'class="productListing-data"',
							 'text' => TEXT_NO_PRODUCTS);

 new productListingBox($list_box_contents);
}

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
 <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
 <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
<?php if ($add_multiple == "1"){
?>
 <tr> 
<td align="left" class="main"><!--a href="<//?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'file:///Y|/Documents/Websites/Best%20Test%20Site/catalog/includes/modules/%20', 'SSL'); ?>"><//?php echo tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT); ?></a--></td>
		<td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> 
 </tr> 
<?php } ?>
</table>
<?php
}
?>

Link to comment
Share on other sites

this is a wild shot if you want to try

change

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now);

to

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now,
'text' => " <hr>");

Link to comment
Share on other sites

try puting the code for the line in the loop

if you post the code for loop maybe i can point you in the right direction

stew are you going totackle the diffrent layout for diffrent category ?

 

 

I am trying to do that... but do not know PHP well enough to get an accurate entry.

 

What i did was replace

 

if ($col > PRODUCT_LIST_COL_NUM-1) {

$col = 0;

$row ++;

}

}

 

 

with....

 

if ($col > PRODUCT_LIST_COL_NUM-1) {

$col = 0;

$row ++;} ?>

 

<tr><td><hr></td></tr>

<?php

$row ++;

 

 

 

}

 

that got me what is at....

 

http://carpenoctem.tv/catalog/index.php?cPath=75_76

 

 

it is displaying the lines... just in the wrong place.....

 

and it is displaying the items... however.... only in 1 column....

 

let me know what you guys think.....

 

should i put the code for the line someplace else?

Link to comment
Share on other sites

this is a wild shot if you want to try

change

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now);

to

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now,
'text' => " <hr>");

nana.....

 

where should i put the code that you are suggesting.... i did not see any of the coding that you are recommending to replace......

 

let me know...... best regards....

Link to comment
Share on other sites

its near the end of the file, did you try using "find" in your test editor? Search for $column >= 3

 

I'm still having trouble with this double "buy now" etc., maybe this contrib isn't compatible with the product sort I am using?

Edited by jeffy777
Link to comment
Share on other sites

its near the end of the file, did you try using "find" in your test editor? Search for $column >= 3

 

I'm still having trouble with this double "buy now" etc., maybe this contrib isn't compatible with the product sort I am using?

 

 

maybe there is something there that I am not seeing......

 

here is the code in my product_listing_col file...

 

<?php

/*

-- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet

 

$Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- product_listing_col //-->

<?php

 

DEFINE('PRODUCT_LIST_COL_NUM',3);

 

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

?>

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

<tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<!-- <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

--> </tr>

</table>

<?php

}

 

$info_box_contents = array();

 

if ($listing_split->number_of_rows > 0) {

 

$row = 0;

$col = 0;

 

$listing = tep_db_query($listing_split->sql_query);

while ($listing_values = tep_db_fetch_array($listing)) {

 

$listing_values['products_name'] = tep_get_products_name($listing_values['products_id']);

 

$lc_text= '<a class="boxText" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_model'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a class="boxText" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_model'] . '</a>';

 

if ($listing_values['specials_new_products_price']) {

$lc_text .= ' <s>';

//. $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> ';

 

} else {

$lc_text .= ' ';

// . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' ';

}

 

if (PRODUCT_LIST_BUY_NOW) {

$lc_text .= '<br><a class="boxText" href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> ';

}

 

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="boxText" width="33%" valign="bottom"',

'text' => $lc_text);

 

if ($col > PRODUCT_LIST_COL_NUM-1) {

$col = 0;

$row ++; } ?>

 

<tr><td><hr></td></tr>

<?php

 

 

 

}

 

new contentBox($info_box_contents);

 

} else {

 

$info_box_contents = array();

 

$info_box_contents[0] = array('params' => 'class="productListing-odd"');

$info_box_contents[0][] = array('params' => 'class="productListing-data"',

'text' => TEXT_NO_PRODUCTS);

 

new contentBox($info_box_contents);

 

}

 

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

?>

<table width="100%">

<tr>

<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<!-- <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

--> </tr>

</table>

<?php

}

?>

 

 

please let me know where you think i should add in the suggested code....

 

Mark

Link to comment
Share on other sites

It looks like you're using an older version of the contrib?

 

I second that emotion.

 

 

 

try puting the code for the line in the loop

if you post the code for loop maybe i can point you in the right direction

stew are you going totackle the diffrent layout for diffrent category ?

 

 

Frank, if you feel the need to display your mad skilz, by all means please do so. I am only an egg.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

i am sorry no mad skills just bored as hell and i couldn't figure it out either.

but i managed to set the diffrent display for diffrent category going

let me know if you want the files and i send it to you to add it to your contribution i just used the other one that i mentioned to you i have used the older version so it does not have these stuff about pricing you have to do that do not know a thing about it

Edited by nana
Link to comment
Share on other sites

Frank, have you tried combining this Product Listing in Columns contrib with this Product Sort contrib:

http://www.oscommerce.com/community/contributions,2541 (latest revised version)

 

If you can get it to work properly, that would be incredibly cool :)

 

It still keeps displaying improperly for me (shows 2 "buy now" buttons per product, etc.)

 

Thanks for all your hard work guys!

Edited by jeffy777
Link to comment
Share on other sites

do you have any recommendations for what to try and add to the css file, and under what label? i tried playing with it just a bit... and seeing what came up... and couldnt get it even to do lines around everything...... where did you put the border-bottom code?

 

what if i just wanted to have something like having each row be its own table....... i bet that would work for the lines...... say like

<table>

<tr>

<td>product1</td>

<td>product2</td>

<td>prodcut3</td>

</tr></table>

<table>

<tr>

<td><img src=..... code for horiztontal line...></td>

</tr></table>

<table>

<td>product4</td>

<td>product5</td>

<td>prodcut6</td>

.

.

.

.

.

 

is something like that possible?????

 

The classes in question for the version of the contribution you're using are "infoBoxContents" and "boxText" but you can't really change these for the purpose of what you're trying to accomplish as these classes are used throughout the site in many places.

 

The new version, currently 2.1, uses "productListing" for tables, "productListing-odd" & "productListing-even" for tr, and "productListing-data" for td, all of which, I believe, are unique to product_listing.php and it's red-headed stepchild cousin product_listing_col.php.

 

Maybe Frank can help you more with that hr thing, because I can't get my head around how to write the code for that purpose, or even where to put it for that matter.

 

border-style: dotted;

 

or

 

border-style: solid;

 

using CSS (stylesheet.css) is what I recommend. If you want to fiddle with it, do a Google for "border-style-bottom" and/or "border-style-top", poke around the results a little, play with the stylesheet, and see what you come up with. Most of what I've learned has come from trial and error.

 

These are at least some, but probably not all, of the border attributes you can change using css:

 

# border

# border-top

# border-bottom

# border-left

# border-right

# border-style (solid, double, groove, ridge, inset, outset, dotted, dashed)

# border-style-top

# border-style-bottom

# border-style-left

# border-style-right

# border-width

# border-color

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

this is a wild shot if you want to try

change

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now);

to

if ($column >= 3 || $x == ($no_of_listings -1) ) {
$row ++; // we start a new tr here with $list_box_contents
$list_box_contents[$row] = array('params' => $class_for_buy_now,
'text' => " <hr>");

 

 

I tried doing this.... and it only put a line at the bottom of the first column....

 

i then tried doing something like....

if ($column >= 3 || $x == ($no_of_listings -1) ) {

$row ++; // we start a new tr here with $list_box_contents

$list_box_contents[$row] = array('params' => $class_for_buy_now,

'text' => " </table><table width=100%><tr><td><hr></td></tr></table><table>");

 

and it put a line on the outside of the table... but at the bottom (right above where it says the number of products).

 

any other suggestions????

Edited by carpenoctem
Link to comment
Share on other sites

The classes in question for the version of the contribution you're using are "infoBoxContents" and "boxText" but you can't really change these for the purpose of what you're trying to accomplish as these classes are used throughout the site in many places.

 

The new version, currently 2.1, uses "productListing" for tables, "productListing-odd" & "productListing-even" for tr, and "productListing-data" for td, all of which, I believe, are unique to product_listing.php and it's red-headed stepchild cousin product_listing_col.php.

 

Maybe Frank can help you more with that hr thing, because I can't get my head around how to write the code for that purpose, or even where to put it for that matter.

 

border-style: dotted;

 

or

 

border-style: solid;

 

using CSS (stylesheet.css) is what I recommend. If you want to fiddle with it, do a Google for "border-style-bottom" and/or "border-style-top", poke around the results a little, play with the stylesheet, and see what you come up with. Most of what I've learned has come from trial and error.

 

These are at least some, but probably not all, of the border attributes you can change using css:

 

# border

# border-top

# border-bottom

# border-left

# border-right

# border-style (solid, double, groove, ridge, inset, outset, dotted, dashed)

# border-style-top

# border-style-bottom

# border-style-left

# border-style-right

# border-width

# border-color

 

in the stylesheet i also tried

 

TD.productListing-data {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

background: #ffffff;

border: 1px;

border-style: solid;

border-color: #000000;

border-spacing: 1px;

}

 

 

and it did not do anything at all...... any other suggestions on where to try?

 

(By the way i upgraded to the new product listing version.... so now we can talk about apples and apples)

Link to comment
Share on other sites

in the stylesheet i also tried

 

TD.productListing-data {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

background: #ffffff;

border: 1px;

border-style: solid;

border-color: #000000;

border-spacing: 1px;

}

and it did not do anything at all...... any other suggestions on where to try?

 

(By the way i upgraded to the new product listing version.... so now we can talk about apples and apples)

 

 

I got it to work... (sorry for the numerous posts)

 

in the css file just use

TD.productListing-data {

 

font-family: Verdana, Arial, sans-serif;

 

font-size: 10px;

border-bottom-width:1px;

border-bottom-color: #000000;

border-bottom-style:solid;

 

}

 

in case anybody wants to know how to do this in the future.

Link to comment
Share on other sites

i am sorry no mad skills just bored as hell and i couldn't figure it out either.

but i managed to set the diffrent display for diffrent category going

let me know if you want the files and i send it to you to add it to your contribution i just used the other one that i mentioned to you i have used the older version so it does not have these stuff about pricing you have to do that do not know a thing about it

 

Absolutely, send it to me and I'll get going on it.

 

Thanks!

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

good job, I'm glad you didn't give up :)

 

Now if only I could solve my problem.....:(

 

 

you know, for about 15 minutes mine was showing the name of the item twice (and the links were not connected.... ie... if i moused over one, it did not affect the other)

 

the problem that i had was that I had a number in the model and in the name slot in the admin section....

 

now i understand tha tyou want the buy now button but try playing around maybe with the number that you are using for it..

 

But try this.... just for the hell of it..... give the Buy Now button.... the value of 1 in the control panel, and the name the value of 1......

 

then all we have to figure out is how to make the buy now button show up below the text....

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