Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Description 1.3


Guest

Recommended Posts

Having a problem after installing this;

When trying to add a new products, error ocours at the short description:

Fatal error: Call to undefined function tep_get_short_desc() in /home/autobils/public_html/ostest6/admin/categories.php on line 728

 

Anyone know how to fix it? Database table is added.

 

Line 728:

<td class="main"><?php echo tep_draw_textarea_field('short_desc[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (isset($short_desc[$languages[$i]['id']]) ? stripslashes($short_desc[$languages[$i]['id']]) : tep_get_short_desc($pInfo->products_id, $languages[$i]['id']))); ?></td>
Link to comment
Share on other sites

  • Replies 297
  • Created
  • Last Reply

Top Posters In This Topic

//------------helper function

function tep_get_short_desc($product_id, $language = '') {
global $languages_id;

 if (empty($language)) $language = $languages_id;

 $product_query = tep_db_query("select short_desc from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'");
 $product = tep_db_fetch_array($product_query);

 return $product['short_desc'];
}

//--------------------

Add to /admin/includes/functions/general.php

 

BACKUP THE FILE BEFORE MAKING EDITS.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

//------------helper function

function tep_get_short_desc($product_id, $language = '') {
global $languages_id;

 if (empty($language)) $language = $languages_id;

 $product_query = tep_db_query("select short_desc from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'");
 $product = tep_db_fetch_array($product_query);

 return $product['short_desc'];
}

//--------------------

Add to /admin/includes/functions/general.php

 

BACKUP THE FILE BEFORE MAKING EDITS.

Thanks!

 

Forgot to save the file in dreamweaver :)

Link to comment
Share on other sites

  • 2 weeks later...

I began to build my very first osCommerce web shop and after I installed osCommcerce successfully I added the newest version of contribution 3123 "Products Short Description" and I am facing the following problems which I (osc newbee & php beginner) cannot solve by myself. :blush:

 

Thank you very much for your help. :)

 

img-1.jpg

http://www.internet-biz-team.com/index.php

This needs to be corrected: The product does not show the correct Short Description, but the first words from the product description itself.

 

 

img-2.jpg

http://www.internet-biz-team.com/products-...ls-c-22_23.html

This needs to be corrected: The product shows the Product Name only but not the Short Description

 

 

img-3.jpg

http://www.internet-biz-team.com/products_new.php

The product shows the correct Short Product Description as it should be with the others too.

 

 

img-4.jpg

http://www.internet-biz-team.com/our-products-c-22.html

This needs to be corrected: The header is not shown at all and the name of the sub-category "Email Tools" is shown two times and the Short Description is not shown

 

 

img-5.jpg

http://www.internet-biz-team.com/shopping_cart.php?sort=2a

This needs to be corrected: The product in the cart shows the Product Name only but not the Short Description

 

 

 

If you need to see any code please tell me from which file and I will post it asap.

 

I hope someone can help me solving these problems. :huh:

 

Kind regards,

Tony

 

:) :) :)

Edited by alpha2007
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Tag Description as Short Description in product listing.

Hello All, I was looking for a contribution like this one. I have also installed in my site Header Tags SEO v3.1.8 and table products_description has a field "products_head_desc_tag" so I thought it would be I great idea to use that field as the short description to be used in product listing.

After reading the installation of Product Description 1.3 this is what I did:

 

Opened catalog/index.php and added "pd.products_head_desc_tag, " after

 

$listing_sql = "select " . $select_column_list . " p.products_id, so all your lines that starts now with:

 

$listing_sql = "select " . $select_column_list . " p.products_id, pd.products_head_desc_tag, ... and the rest of the query continues with no more changes.

 

Then opened catalog/includes/modules/product_listing.php and replace this code:

 

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;

 

 

with this:

 

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']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['products_head_desc_tag'] . '</b>';

} else {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['products_head_desc_tag'] . '</b>';}

break;

 

All credits to developer of Header Tags SEO and Product Description contribs

 

Enjoy!

Link to comment
Share on other sites

  • 3 weeks later...

I'm currently still installing, but have run into an issue that worries me. On the catalog/admin/categories.php, Step #9 says to:

 

AROUND 850 2 there are 2 additions that are similar. You have to do both of them.

pd.products_price,

#################### REPLACE WITH #######################//

pd.short_desc, pd.products_price,

 

I've searched everywhere and cannot find "pd.products_price" I believe the 2 instances should likely be somewhere in the below chunk of code very near line 850, but still don't see it anywhere.

 

 $products_count = 0;
   if (isset($HTTP_GET_VARS['search'])) {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
   } else {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
   }
   while ($products = tep_db_fetch_array($products_query)) {
     $products_count++;
     $rows++;

 

I searched this thread, but can't find any other references to this issue. I did just install Product Listing Enhancements, but reviewed my edits and can't see where I might have altered this section, but could be missing something.

 

Any help would be awesome! Thank you in advance,

CArRiE

Link to comment
Share on other sites

Hi All,

 

Not sure if the below FATAL error is related to issues (still unresolved) in post above, but after doing the rest of the install, I'm now getting an error message in admin section when try to edit/add to products:

 

Call to undefined function tep_get_short_desc() in /home/bellaves/public_html/catalog/admin/categories.php on line 546

 

Please, if anyone can help me, I would most appreciate it!

Thank You in Advance,

CArRiE

Link to comment
Share on other sites

I'm having so much trouble! In addition to the FATAL error in my admin section (posted above), when I go to my homepage I'm getting:

 

Fatal error: Cannot redeclare tep_get_short_desc() (previously declared in /home/bellaves/public_html/catalog/includes/functions/general.php:519) in /home/bellaves/public_html/catalog/includes/functions/general.php on line 526

 

I'm afraid I am going to have to uninstall... I'm going over everything with a fine tooth comb, but if it's all due to the missing code that I couldn't find anywhere (see first post), then it's not going to do me any good. Urgh!

Link to comment
Share on other sites

I cant seem to do this step i cant find it in my php file

 

 

24/ ###################### FIND ######################### AROUND 89

 

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

 

####################### REPLACE WITH ###############################

 

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . $products_new['short_desc'] . '<br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

 

 

here is my file

 

<?php
/*
 $Id: products_new.php,v 1.27 2003/06/09 22:35:33 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');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
 	<td valign="top">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php /*  require(DIR_WS_BOXES . 'panel_top.php');  */ ?>     

<? tep_draw_heading_top();?>		

<? new contentBoxHeading_ProdNew($info_box_contents);?>





<?php
 $products_new_array = array();

 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

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


		<table border="0" cellspacing="0" cellpadding="0" class="result box_width_cont">
		  <tr>
			<td><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
			<td class="result_right"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
		  </tr>
		</table>

<?php echo tep_draw_result_top(); ?>


<?php
 }
?>

<?php
 if ($products_new_split->number_of_rows > 0) {
   $products_new_query = tep_db_query($products_new_split->sql_query);









  $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($products_new = tep_db_fetch_array($products_new_query)) {

$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_new['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
     $product = tep_db_fetch_array($product_query);

      $p_desc = $product['products_description'];
       $p_id = $product['products_id'];

  if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
       $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> ' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '';
     } else {
       $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
     }
   $products_new['products_name'] = tep_get_products_name($products_new['products_id']);
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => ' class="bg3" style=" width:50%;"',
                                          'text' => ''.tep_draw_prod_top().'
								<table cellspacing="0" cellpadding="0" border="0">
									<tr>
										<td>'.tep_draw_separator('spacer.gif', $w_spacer, '1').'</td>
										<td width="100%" height="150">
											<table cellspacing="0" cellpadding="0" border="0" >
												<tr><td>
													<table cellpadding="0" cellspacing="0" border="0">
														<tr><td>'.tep_draw_separator('spacer.gif', '19', '1').'</td>
															<td height="104"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br></td>
															<td>'.tep_draw_separator('spacer.gif', '2', '1').'</td>
															<td width="100%" height="104">
																<br style="line-height:18px">
																<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . substr( $products_new['products_name'],0,MAX_DESCR_NAME) . '</a><br>
																<br style="line-height:33px">
																<strong>'.$products_price.'</strong><br>
														</td></tr>
													</table>
												</td></tr>
												<tr><td height="1">
													<table cellpadding="0" cellspacing="0" border="0">
														<tr><td>'.tep_draw_separator('spacer.gif', '15', '1').'</td>
															<td style="width:100%;background:url(images/line_bg.gif) left top repeat-x;">'.tep_draw_separator('spacer.gif', '1', '1').'</td>
															<td>'.tep_draw_separator('spacer.gif', '15', '1').'</td>
														</tr>
													</table>
												</td></tr>
												<tr><td align="center"><br style="line-height:11px">
													<table cellpadding="0" cellspacing="0" border="0" style=" width:150px;">
														<tr>
															<td><a href="' . tep_href_link('product_info.php?products_id='.$products_new['products_id']) . '">'.tep_image_button("button_details.gif").'</a></td><td>'.tep_draw_separator('spacer.gif', '10', '1').'</td>
															<td width="100%"><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$products_new['products_id']).'">'.Tep_Image_Button('button_add_to_cart1.gif').'</a></td>
														</tr>
													</table>
												</td></tr>
											</table>
										</td>
										<td>'.tep_draw_separator('spacer.gif', $w_spacer, '1').'</td>
									</tr>
								</table>
								'.tep_draw_prod_bottom());



   $col ++;
   if ($col > 1) {
     $col = 0;
     $row ++;
   }
 }






    new contentBox($info_box_contents);



 } else {
?>        
			  <table border="0" cellspacing="0" cellpadding="0" class="result box_width_cont">
				  <tr><td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td></tr>
				  <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>
			  </table>
<?php
 }
?>

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

<?php echo tep_draw_result_bottom(); ?>

			<table border="0" cellspacing="0" cellpadding="0" class="result box_width_cont">
			  <tr>
				<td><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
				<td class="result_right"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
			  </tr>
			</table>


<?php
 }
?>


<? tep_draw_heading_bottom();?>

</td>
   <td valign="top">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </td>
 </tr>
</table>
<!-- body_eof //-->

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

 

And what the heck is this part

 

Multimixer additions 20.7.2009 for FEATURED PRODUCTS

##################### OPEN FILE catalog/featured_products.php #####################

25/ ######################### FIND ##########################	AROUND 60

$featured_products_query_raw = "select p.products_id, pd.products_name,

######################### ADD AFTER ####################

pd.short_desc,

26/ ###################### FIND #########################	AROUND 101

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b><u>' . $featured_products['products_name'] . '</u></b></a><br><br><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

####################### REPLACE WITH ###############################

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b><u>' . $featured_products['products_name'] . '</u></b></a><br>' .  TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products['manufacturers_name'] . '<br><br>' .  $featured_products['short_desc'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

##################### OPEN FILE catalog/includes/modules/featured.php #####################

27/ ######################### FIND ##########################	AROUND 35

   $query = 'SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name ';

####################### REPLACE WITH ###############################

   $query = 'SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name, pd.short_desc ';


############################ SAVE FILE & FINISH ##########################

 

the download dont have featured.php ??? so what is that?? can you help me to put my product name at top midle of the box then below it the short description here is my site

 

My link

 

please i need help..

 

 

i want it to go like

samplm.jpg

 

ill Appreciate your help..

Edited by halluzineyt
Link to comment
Share on other sites

  • 4 weeks later...

Hi. I need some help.

There seems to be a trouble in my product_listing.php file. The data does't go in the right place. The item price is not showed, and the product name and short description are not in the right place.

Here's a screenshot to show you what's my problem:

screenshot01yk.th.jpg

 

This is my file:

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

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
 $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();

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
   switch ($column_list[$col]) {
     case 'PRODUCT_LIST_MODEL':
       $lc_text = TABLE_HEADING_MODEL;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_PRICE':
       $lc_text = TABLE_HEADING_PRICE;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $lc_text = TABLE_HEADING_QUANTITY;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $lc_text = TABLE_HEADING_WEIGHT;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $lc_text = TABLE_HEADING_IMAGE;
       $lc_align = 'center';
       break;
     case 'PRODUCT_LIST_BUY_NOW':
       $lc_text = TABLE_HEADING_BUY_NOW;
       $lc_align = 'center';
       break;
   }

   if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
     $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
   }

   $list_box_contents[0][] = array('align' => $lc_align,
                                   'params' => 'class="productListing-heading"',
                                   'text' => ' ' . $lc_text . ' ');
 }

 if ($listing_split->number_of_rows > 0) {
   $rows = 0;
   $column = 0;
   echo '   

      <table cellspacing=0 cellpadding=0 width=437 align=center>
       <tr><td background=images/m22.gif width=437 height=29 valign=top>
        <table cellspacing=0 cellpadding=0>
         <tr><td height=8></td></tr>
         <tr><td width=25></td><td class=ch6>productos dentro de la categoría seleccionada</td></tr>
        </table>
       </td></tr>
       <tr><td valign=top class=ch7>


          <table cellspacing=0 cellpadding=0 width=417 border=0 align=center>
            <tr><td height=18></td></tr>
            <tr><td colspan=3 class=ch13>    <u>'.$breadcrumb->trail(' » ').'</u></td></tr>
            <tr><td height=15></td></tr>
            <tr>








        ';

   $listing_query = tep_db_query($listing_split->sql_query);
   while ($listing = tep_db_fetch_array($listing_query)) {
     $product_contents = array();
     $rows++;
     if (($rows/2) == floor($rows/2)) {
       $list_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
       $list_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($list_box_contents) - 1;

     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']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';
               } else {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';} 
          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 = '<span class=ch8 style="color:#7F7F7F;font-size:11px"><s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s></span><br>         <span class=ch8>' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
           } else {
             $lc_text = '<span class=ch8>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
           }       
           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;
         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;
       }

       $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
       $product_contents[] = $lc_text;       
     }


     $product_query = tep_db_query("select products_description  from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)1 . "'");
     $product = tep_db_fetch_array($product_query);
     $new_products['products_description'] = $product['products_description'];

     echo '

            <td width=208 valign=top align=center>
              <table cellspacing=0 cellpadding=0 width=200 align=center>
               <tr><td width=90 align=center valign=top>'.$product_contents[0].'</td>
               <td valign=top>
                 <table cellspacing=0 border=0  cellpadding=0>
                  <tr><td height=55 valign=middle>'.$product_contents[1].'</td></tr>
                  <tr><td height=0></td></tr>
                  <tr><td height=35 valign=middle><span  class=ch11>Precio: </span> <span class=ch8>'.$product_contents[2].'</span> </td></tr>
                 </table>
                </td>
               </tr>
               <tr><td height=2></td></tr>
               <tr><td colspan=2 align=right><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image_button('small_view.gif') . '</a><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_in_cart.gif') . '</a>   </td></tr>
             </table>
            </td>



     ';
     $column ++;
     if ($column >= 2) {
       $rows ++;
       $column = 0;
       echo '

            </tr>
            <tr><td height=5></td></tr>
             <tr><td colspan=3 valign=top>
              <table cellspacing=0 cellpadding=0>
               <tr><td width=200 height=1 background=images/m29.gif></td><td width=14></td> <td width=200 height=1 background=images/m29.gif></td></tr>
              </table>
             </td></tr>
             <tr><td height=5></td></tr>
             <tr>


            ';
     } else echo '<td background=images/m09.gif width=1></td>';



   }

   echo '

                    </tr>                    
             </table>
        </td></tr>
       <tr><td><img src=images/m30.gif width=438 height=7></td></tr>
      </table>


        ';

   //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);

   echo '<div class=PageHeading>Categories</div>';
   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 height=20></td></tr>
 <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
 }
?>

 

I hope you can help me.

Thanks.

Link to comment
Share on other sites

 

 

Not sure what your doing or what you've changed, you dont say, perhaps you be better with a add-on, like Product Listing Enhancements, Thumbnails & Manufacturer Headings http://addons.oscommerce.com/info/6051

Sam

 

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

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Uploaded Version 2, A Complete Rewrite

 

Having written a similar function of this for Product Listing Enhancements, Thumbnails & Manufacturer Headings http://addons.oscommerce.com/info/6051

 

I looked at this and not liking add-ons that are un-necessarily complex (of which there are far too many) I have produced this re-write, that basically uses the code that I used before.

 

Instead of 7 files to edit, there are now just 2.

 

A mooded osC2.2rc2a listing module file is included if you wish to just swap files.

 

 

Enjoy biggrin.gif

Sam

 

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

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I'm still trying to solve my problem with no success. This are more details:

-I delete the products manufacturers, nothing changes.

-I have uploaded the original osc product_listing.php but the trouble persist (it don't show the short description, but the price and name aren't in the right place)

-My items are showed right when I enter to a full info of each one, with the correct data and places for it.

-In my localhost (testing server) the contribution seems to work good, with the same files I have on my hosting server.

 

Can be a configure.php or another configuration file error?

Link to comment
Share on other sites

 

 

 

Not sure what your trying to say, try putting things in clear simple terms and don't 'wafle'

 

Perhaps you have stuctural errors, test your page with w3c http://validator.w3.org

 

Have you tried using the file in the latest package ?

 

Have you set in admin field position u want?

Sam

 

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

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi Spooks,

 

Just a quick question concerning your rewrite.

 

What would be the call to display the product truncated description in a general page of the site.

 

Cheers Fab

Link to comment
Share on other sites

Hi Spooks,

 

Just a quick question concerning your rewrite.

 

What would be the call to display the product truncated description in a general page of the site.

 

Cheers Fab

 

 

This is a product listing mod, if you wish to use the function eleswhere it would require additional code (this was the case with the last version too)

 

What needed would depend on where u doing it.

Sam

 

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

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

 

What needed would depend on where u doing it.

 

Hi Sam,

 

I was of the idea to create a short description field in the product_info.php page.

 

Regards Fab

Link to comment
Share on other sites

Hi Sam,

 

I was of the idea to create a short description field in the product_info.php page.

 

Regards Fab

 

 

Would a truncated vesion of whats there already be useful?

 

I use the short Description Contrib http://addons.oscommerce.com/info/3123 there as a subtitle to the product name, allows u to write a apt short summary of the product, there is also a meta contrib that allows u to do similar as such short descriptions do have seo uses.

Sam

 

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

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

nice and easy v2, thanks Sam.

To make v2 ML (MultiLanguage) add in your languages file (e.g. includes / languages / dutch.php) the following define:

define('MORE', 'Lees meer');

or in: includes / languages / german.php add

define('MORE', 'Lies mehr');

Other languages: translate the words.

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

  • 2 weeks later...

Uploaded Version 2, A Complete Rewrite

 

Having written a similar function of this for Product Listing Enhancements, Thumbnails & Manufacturer Headings http://addons.oscommerce.com/info/6051

 

I looked at this and not liking add-ons that are un-necessarily complex (of which there are far too many) I have produced this re-write, that basically uses the code that I used before.

 

Instead of 7 files to edit, there are now just 2.

 

A mooded osC2.2rc2a listing module file is included if you wish to just swap files.

 

 

Enjoy biggrin.gif

 

 

Hi Sam

 

I have just installed your contribution and it works great for the product listing. I was just wondering if the New Products page could be ammended to show the same? I'm a newbie to all this so any help you can give would be great.

 

Thanks

 

Jayne

Link to comment
Share on other sites

Hi Sam

 

I have just installed your contribution and it works great for the product listing. I was just wondering if the New Products page could be ammended to show the same? I'm a newbie to all this so any help you can give would be great.

 

Thanks

 

Jayne

 

it's ok... I worked it out myself.

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