Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

item descriptions crossing into others, not supposed to


dcrider1

Recommended Posts

Posted

I dont know how to explain this properly, but on the homepage of the catalog, the last 4 added items are shown in a square table. The top left item description goes into the top right item. The bottom left goes into the bottom right. If you click on each item though, the correct description is with each item. It only does this on the homepage, that i have seen.

 

You can look here. http://burgersmarketpc.com/catalog/

 

Thanks in advance for any help.

 

p.s. Im still searching for the fix to the " ) " in the top right corner of the mid table of the home page. :)

Posted

I dont know how to explain this properly, but on the homepage of the catalog, the last 4 added items are shown in a square table. The top left item description goes into the top right item. The bottom left goes into the bottom right. If you click on each item though, the correct description is with each item. It only does this on the homepage, that i have seen.

 

You can look here. http://burgersmarketpc.com/catalog/

 

Thanks in advance for any help.

 

p.s. Im still searching for the fix to the " ) " in the top right corner of the mid table of the home page. :)

 

Hi,

 

The small fix you will probably find in index.php towards the bottom just look for <td class="pageHeading">

 

It is a template so maybe product_info.php if you can not see in the index.php.

If you view your page source in your browser you should be able to quickly find.

The link problem I can not see!!! the small product description seems to be limited to about 15 characters so you are getting just the first few words of the product description.

 

Maybe I am not seeing the problem??

 

John

To improve is to change; to be perfect is to change often.

 

Posted

Hi,

 

The small fix you will probably find in index.php towards the bottom just look for <td class="pageHeading">

 

It is a template so maybe product_info.php if you can not see in the index.php.

If you view your page source in your browser you should be able to quickly find.

The link problem I can not see!!! the small product description seems to be limited to about 15 characters so you are getting just the first few words of the product description.

 

Maybe I am not seeing the problem??

 

John

 

If you actually click on each item, you will see that the first characters of the descriptions for each item are not alike. So on the homepage, they would/shouldn't be alike. What are you saying to do with the

<td class="pageHeading">
?

 

Can i change how many characters are shown on the home page description for each item?

 

Thanks!

Posted

If you actually click on each item, you will see that the first characters of the descriptions for each item are not alike. So on the homepage, they would/shouldn't be alike. What are you saying to do with the ?

 

Can i change how many characters are shown on the home page description for each item?

 

Thanks!

 

Hi,

I can not really say because it is a template you should look first for the small fix for the entry <td class="pageHeading"> after this you will see the offending

 

) (bracket) which you just remove probably the index.php.

 

Then also in the index php find out which code is calling the box just below whats new whats new here could be simply the /includes/modules/new_products.php but probably a custimised box.

 

It is a bit difficult to say what the source of the problem is with the description.

 

I see now what you mean this is really a bug hunting issue!

 

I personaly would start by inserting original files (ignoring in the first instance the layout) and first try to get the proper description showing I would first look in Index.php/...and then in the includes/modules files all in all a bit buggy!!

 

What is happening in the admin when you insert the product are the functions OK ??

To improve is to change; to be perfect is to change often.

 

  • 4 weeks later...
Posted

Hi,

I can not really say because it is a template you should look first for the small fix for the entry <td class="pageHeading"> after this you will see the offending

 

) (bracket) which you just remove probably the index.php.

 

Then also in the index php find out which code is calling the box just below whats new whats new here could be simply the /includes/modules/new_products.php but probably a custimised box.

 

It is a bit difficult to say what the source of the problem is with the description.

 

I see now what you mean this is really a bug hunting issue!

 

I personaly would start by inserting original files (ignoring in the first instance the layout) and first try to get the proper description showing I would first look in Index.php/...and then in the includes/modules files all in all a bit buggy!!

 

What is happening in the admin when you insert the product are the functions OK ??

 

 

Sorry! Its been a month, i got sidetracked with home projects. I have found and terminated the bracket in the corner!! Yeah, finally!!

 

Now on to the description issue!? Explain to me again, where and what to look for. Thanks for all your help!

Posted

Here is the index.php code

<?php
 if ($category_depth == 'nested') { // categoies with subcategory
 	$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="head_table">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading2" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td align="center"><table border="0" cellspacing="10" cellpadding="5"  class="categ_table">
             <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,'class="subcategory_image"') . '<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 include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
         </tr>
       </table></td>
     </tr>
   </table><?php  
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) { // categoies without subcategory

// create column list
	$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
						 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
						 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
						 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
						 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
						 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
						 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
						 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

	asort($define_list);

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

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

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

	if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
	  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
		if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
		  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
		  $listing_sql .= " order by pd.products_name";
		  break;
		}
	  }
	} else {
	  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
	  $sort_order = substr($HTTP_GET_VARS['sort'], 1);
	  switch ($column_list[$sort_col-1]) {
		case 'PRODUCT_LIST_MODEL':
		  $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
		  break;
		case 'PRODUCT_LIST_NAME':
		  $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
		  break;
		case 'PRODUCT_LIST_MANUFACTURER':
		  $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
		  break;
		case 'PRODUCT_LIST_QUANTITY':
		  $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
		  break;
		case 'PRODUCT_LIST_IMAGE':
		  $listing_sql .= " order by pd.products_name";
		  break;
		case 'PRODUCT_LIST_WEIGHT':
		  $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
		  break;
		case 'PRODUCT_LIST_PRICE':
		  $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
		  break;
	  }
	}
?>
	<table border="0" width="<?php echo $content; ?>" cellspacing="0" cellpadding="0">
	  <tr>
		<td><table border="0" width="<?php echo $content; ?>" cellspacing="0" cellpadding="0" class="head_table">
		  <tr>
			<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
	if (PRODUCT_LIST_FILTER > 0) {
	  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
	  } else {
		$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
	  }
	  $filterlist_query = tep_db_query($filterlist_sql);
	  if (tep_db_num_rows($filterlist_query) > 1) {
		echo '<td align="left" class="pageHeading3" width="190"' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . ' ';
		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 tep_hide_session_id() . '</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'];
	}
?>
		   <?php echo HEADING_IMAGE_WIDTH  ? '<td class="pageHeading2" width="'.HEADING_IMAGE_WIDTH.'">'.tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT).'</td>' : ''; ?>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . "product_listing_2.php"); ?></td>
	  </tr>
	</table>
<?php

 } else { // default page
?>
<table border="0" cellspacing="0" cellpadding="0">
     <tr>
        <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
     </tr>
</table><?php
 }
?>

 

 

and here is the new_products.php code file that is under modules

 

<?php
/*
 $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/

 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.manufacturers_id,  p.products_tax_class_id,  if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
   $new_products_query = tep_db_query("select distinct p.products_id, p.manufacturers_id, p.products_image, p.products_tax_class_id,  if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }
 $row = 0;
 $col = 0;
 $info_box_contents = array();
 $arr_manuf = tep_get_manufacturers();
 $list_manuf = array();
 foreach ($arr_manuf as $arr_manuf_v){
   $list_manuf[$arr_manuf_v['id']] = $arr_manuf_v['text'];}
 while ($new_products = tep_db_fetch_array($new_products_query)) {
   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
   $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
   $product = tep_db_fetch_array($product_query);
   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
   $info_box_contents[$row][$col] = array('align' => 'right',
                                          'params' => 'class="smallText" width="50%" valign="top"',
                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' ') . '</a>',
                                          'zg'=>'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>' ,
                                          'price'=> $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])),
                                          'newpr'=> $currencies->display_price($new_price, tep_get_tax_rate($new_products['products_tax_class_id'])),
                                          'id'=>$new_products['products_id'],
                                          'des'=>$product['products_description'],
                                          'img'=>$new_products['products_image'],
                                          'manuf'=>$list_manuf[$new_products['manufacturers_id']],
                                          'name'=>$new_products['products_name']
                                          );
   $col ++;
   if ($col > 10) {
     $col = 0;
     $row ++;
   }
 }
$st_key = false;
$kk=0;
$max_c=1;
$max_i=MAX_DISPLAY_NEW_PRODUCTS;
?>
<table border="0" width="<?php echo $_kol_cn; ?>" cellspacing="0" cellpadding="0" class="head_table">
         <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>
<?php
 /*echo '<table width="'.$content.'" border="0" cellpadding="0" cellspacing="0" style="padding:0; margin:0;">'.
   '<tr><td style="padding:15px 0 0 25px">';
 echo tep_image_button("zag_pr_p.gif","Featured products");
 echo '</td></tr></table>';*/
 echo '<table width="'.$content.'" border="0" cellpadding="0" cellspacing="2" style="padding:0; margin:0;">'.
   '<tr valign="top"><td style="padding:15px 0 0 0px">';
// START
   for ($i_=0;$i_<$max_i; $i_=$i_+=2){
   $align='left';
   $align2='right';
   if ($st_key) {
     $st_key = false;
     $k=0;
   } else {
     $st_key = true;
     $k=1;
   }
   $kk++;
if ($kk == 1) {$align='right';$align2='left';}
if($info_box_contents[0][$i_]["zg"]!=''){
?>

<table border="0" cellpadding="0" cellspacing="0">
 <tr>
   <td style="padding:0px 0 0 12px">
   <div class="goods">
   <div style="padding:10px 0 0 8px">
   <div class="item_zag_main zag" style="text-align:center"><?php echo $info_box_contents[0][$i_]["zg"] ;?></div>	
   <div style="float:left;padding:20px 10px 0 10px; width: <?php echo SMALL_IMAGE_WIDTH; ?>px"><?php echo $info_box_contents[0][$i_]["text"];?></div>
   <div class="item_des" style="padding-top:25px"><?php echo substr($info_box_contents[0][$i_]["des"],0,14);?></div>
		<div style="height:13px"></div>
		<div class="item_price"><?php echo $info_box_contents [0][$i_]['price']; ?></div>
		<div style=" margin:0px 0 0 0px;"><?php echo  tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),'post','') . tep_image_submit('../../../../../images/button_in_cart.gif', IMAGE_BUTTON_IN_CART,'style="margin:15px 0px 6px 0px; float:left"') . tep_draw_hidden_field('products_id', $info_box_contents[0][$i_]['id']) . '</form>'.'<a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $info_box_contents[0][$i_]['id']).'">'.tep_image_button('../../../../../images/button_det.gif','','style="float:left"').'</a>';?></div> 
	</div>
   </div>
   </td>

       <td style="padding:0px 0 0 0px">
   <div class="goods">
   <div style="padding:10px 0 0 8px">
   <div class="item_zag_main zag" style="text-align:center;"><?php echo $info_box_contents[0][$i_+1]["zg"] ;?></div>	
   <div style="float:left;padding:20px 10px 0 10px; width: <?php echo SMALL_IMAGE_WIDTH; ?>px"><?php echo $info_box_contents[0][$i_+1]["text"];?></div>
   <div class="item_des" style="padding-top:25px"><?php echo substr($info_box_contents[0][$i_]["des"],0,14);?></div>
		<div style="height:13px"></div>
		<div class="item_price"><?php echo $info_box_contents [0][$i_+1]['price']; ?></div>
		<div style=" margin:0px 0 0 0px;"><?php echo  tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),'post','') . tep_image_submit('../../../../../images/button_in_cart.gif', IMAGE_BUTTON_IN_CART,'style="margin:15px 0px 6px 0px; float:left"') . tep_draw_hidden_field('products_id', $info_box_contents[0][$i_+1]['id']) . '</form>'.'<a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $info_box_contents[0][$i_+1]['id']).'">'.tep_image_button('../../../../../images/button_det.gif','','style="float:left"').'</a>';?></div> 
	</div>
   </div>
   </td>
 </tr>
</table>
<?php  } 
 if ( ($i_+2) < $max_i ) {
   if ( !isset($info_box_contents[0][$i_+1]['id']) ) {
  break;
}
if ( $kk == $max_c ) {
  $kk = 0;
  echo '</td></tr><tr><td></td></tr><tr valign="top">';
} else {
  // echo '</td><td>'.tep_image(DIR_WS_IMAGES . 'hor_line.gif').'</td>';
 }
 echo '<td>';
 }
}
echo '<br></td></tr></table>'; ?>

Posted

the functions when adding products in admin, seem to be fine.

 

I just added a false product, jelly, and you can view the page now, and see that the left description is crossing to the right side.

 

I cant figure out what calls these descriptions. In admin, the descriptions are fine and right.

Posted

im almost positive this is where that box/table or whatever you call it is called from. I dont know code, so I cant figure out what the problem is in the code.

 

the problem with the site is on the main page(index.php)there is a table 2x2, with the newest products in it. The top left item description is repeated on the top right, although the items and prices are different and correct to each. same thing for the bottom left to the bottom right.

 

this is the code for new_products.php

<?php
/*
 $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/

 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.manufacturers_id,  p.products_tax_class_id,  if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
   $new_products_query = tep_db_query("select distinct p.products_id, p.manufacturers_id, p.products_image, p.products_tax_class_id,  if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }
 $row = 0;
 $col = 0;
 $info_box_contents = array();
 $arr_manuf = tep_get_manufacturers();
 $list_manuf = array();
 foreach ($arr_manuf as $arr_manuf_v){
   $list_manuf[$arr_manuf_v['id']] = $arr_manuf_v['text'];}
 while ($new_products = tep_db_fetch_array($new_products_query)) {
   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
   $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
   $product = tep_db_fetch_array($product_query);
   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
   $info_box_contents[$row][$col] = array('align' => 'right',
                                          'params' => 'class="smallText" width="50%" valign="top"',
                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' ') . '</a>',
                                          'zg'=>'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>' ,
                                          'price'=> $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])),
                                          'newpr'=> $currencies->display_price($new_price, tep_get_tax_rate($new_products['products_tax_class_id'])),
                                          'id'=>$new_products['products_id'],
                                          'des'=>$product['products_description'],
                                          'img'=>$new_products['products_image'],
                                          'manuf'=>$list_manuf[$new_products['manufacturers_id']],
                                          'name'=>$new_products['products_name']
                                          );
   $col ++;
   if ($col > 10) {
     $col = 0;
     $row ++;
   }
 }
$st_key = false;
$kk=0;
$max_c=1;
$max_i=MAX_DISPLAY_NEW_PRODUCTS;
?>
<table border="0" width="<?php echo $_kol_cn; ?>" cellspacing="0" cellpadding="0" class="head_table">
         <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>
<?php
 /*echo '<table width="'.$content.'" border="0" cellpadding="0" cellspacing="0" style="padding:0; margin:0;">'.
   '<tr><td style="padding:15px 0 0 25px">';
 echo tep_image_button("zag_pr_p.gif","Featured products");
 echo '</td></tr></table>';*/
 echo '<table width="'.$content.'" border="0" cellpadding="0" cellspacing="2" style="padding:0; margin:0;">'.
   '<tr valign="top"><td style="padding:15px 0 0 0px">';
// START
   for ($i_=0;$i_<$max_i; $i_=$i_+=2){
   $align='left';
   $align2='right';
   if ($st_key) {
     $st_key = false;
     $k=0;
   } else {
     $st_key = true;
     $k=1;
   }
   $kk++;
if ($kk == 1) {$align='right';$align2='left';}
if($info_box_contents[0][$i_]["zg"]!=''){
?>

<table border="0" cellpadding="0" cellspacing="0">
 <tr>
   <td style="padding:0px 0 0 12px">
   <div class="goods">
   <div style="padding:10px 0 0 8px">
   <div class="item_zag_main zag" style="text-align:center"><?php echo $info_box_contents[0][$i_]["zg"] ;?></div>	
   <div style="float:left;padding:20px 10px 0 10px; width: <?php echo SMALL_IMAGE_WIDTH; ?>px"><?php echo $info_box_contents[0][$i_]["text"];?></div>
   <div class="item_des" style="padding-top:25px"><?php echo substr($info_box_contents[0][$i_]["des"],0,16);?></div>
		<div style="height:13px"></div>
		<div class="item_price"><?php echo $info_box_contents [0][$i_]['price']; ?></div>
		<div style=" margin:0px 0 0 0px;"><?php echo  tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),'post','') . tep_image_submit('../../../../../images/button_in_cart.gif', IMAGE_BUTTON_IN_CART,'style="margin:15px 0px 6px 0px; float:left"') . tep_draw_hidden_field('products_id', $info_box_contents[0][$i_]['id']) . '</form>'.'<a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $info_box_contents[0][$i_]['id']).'">'.tep_image_button('../../../../../images/button_det.gif','','style="float:left"').'</a>';?></div> 
	</div>
   </div>
   </td>

       <td style="padding:0px 0 0 0px">
   <div class="goods">
   <div style="padding:10px 0 0 8px">
   <div class="item_zag_main zag" style="text-align:center;"><?php echo $info_box_contents[0][$i_+1]["zg"] ;?></div>	
   <div style="float:left;padding:20px 10px 0 10px; width: <?php echo SMALL_IMAGE_WIDTH; ?>px"><?php echo $info_box_contents[0][$i_+1]["text"];?></div>
   <div class="item_des" style="padding-top:25px"><?php echo substr($info_box_contents[0][$i_]["des"],0,16);?></div>
		<div style="height:13px"></div>
		<div class="item_price"><?php echo $info_box_contents [0][$i_+1]['price']; ?></div>
		<div style=" margin:0px 0 0 0px;"><?php echo  tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),'post','') . tep_image_submit('../../../../../images/button_in_cart.gif', IMAGE_BUTTON_IN_CART,'style="margin:15px 0px 6px 0px; float:left"') . tep_draw_hidden_field('products_id', $info_box_contents[0][$i_+1]['id']) . '</form>'.'<a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $info_box_contents[0][$i_+1]['id']).'">'.tep_image_button('../../../../../images/button_det.gif','','style="float:left"').'</a>';?></div> 
	</div>
   </div>
   </td>
 </tr>
</table>
<?php  } 
 if ( ($i_+2) < $max_i ) {
   if ( !isset($info_box_contents[0][$i_+1]['id']) ) {
  break;
}
if ( $kk == $max_c ) {
  $kk = 0;
  echo '</td></tr><tr><td></td></tr><tr valign="top">';
} else {
  // echo '</td><td>'.tep_image(DIR_WS_IMAGES . 'hor_line.gif').'</td>';
 }
 echo '<td>';
 }
}
echo '<br></td></tr></table>'; ?>

Archived

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

×
×
  • Create New...