Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Description 1.3


Guest

Recommended Posts

great const. - thx

 

it almost works perfectly for me but here's what gets me:

 

on the product_listing in the categories it ain't show the product name instead of it

shows the manufactures name and the link goes also to the manufactory.

 

here's what i mean: product listing

 

can anyone help me with that problem? - want to have the product name and the correct link to the product info

Link to comment
Share on other sites

  • Replies 297
  • Created
  • Last Reply

Top Posters In This Topic

I'm still working on this Problem!

Please is their anyone who can help me with that problem.

I removed the whole constribution and installed it new but the same result.

I become always the manufacturs name and link instead of the products name and link.

Link to comment
Share on other sites

  • 4 weeks later...

Hi, i need help with new_products.php

 

I've tried to edit the files like you said... but my new_products.php file doesn't have that code

i only have troubles with your step number 2 (i think)

here is your code:

and further down i'll post mine for new_products.php (with no changes)

 

so you need to add the short desc to modules\new_products.php

 

1. Modify the queries to retrieve the short description

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.short_desc, 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);

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.short_desc, 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);

 

2. Modify the $info_box_contents array's text to include the short desc

Reformat/Replace this line of code

'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><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

with something like this

'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><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '<br>' . $new_products[short_desc]);

Havent checked the syntax 100% if you have trouble let me know. You may want to customize the boxes.

 

 

now mine:

 

<?php
/*
 edited - 2005/07/01 13:50

 -----------------------------------------

 $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
*/
?>
<!-- new_products //-->
<?php

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


 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>Novos Produtos</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=13></td></tr>
		 <tr>


   ';


 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)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><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, 'vspace=0') . '</a></td>
			<td valign=top>
			  <table cellspacing=0 cellpadding=0>
			   <tr><td><a height=35 valign=middle   class=ch9 href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></td></tr>

			   <tr><td class=ch10 height=35 valign=middle>'.preg_replace('/\s\S*$/i', '', substr($new_products['products_description'], 0, 25)).' ...</td></tr>
			   <tr><td height=0></td></tr>
			   <tr><td><span class=ch11>pre?o:</span> <span class=ch8>'.$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).$new_products['short_desc']);'</span> </td></tr>
			  </table>
			 </td>
			</tr>
			<tr><td height=20></td></tr>
			<tr><td colspan=2 align=right><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['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=' . $new_products['products_id']) . '">' . tep_image_button('button_in_cart.gif') . '</a>   </td></tr>
		  </table>
		 </td>


	';

$col ++;
if ($col > 1) {
  $col = 0;
  $row ++;
  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_products_eof //-->

 

 

 

 

Where and what should i change? thank you. :thumbsup:

Link to comment
Share on other sites

  • 1 month later...

can someone please advise

 

I am using the contribution

 

short description v1 (i have no need for language versions)

 

anyways...i was wondering if some can explain how to display the short description in the product_listing.php page.

 

I have used the version that comes with the download and it still doesn't work...I have tried to modify it and also can't seem to get it to work

 

 

Any help would be greatly appreciated

 

Ilan

Link to comment
Share on other sites

  • 1 month later...

I can't seem to fix the error when I attempt do duplicate a product. I've tried the suggestions by others with the same problem but no go.

 

1136 - Column count doesn't match value count at row 1

insert into products_description (products_id, language_id, products_name, products_description, short_desc, products_url, products_viewed) values ('326', '1', 'Ammar\'s Complete Cups & Balls Book', 'Over 750 photographs and 184 pages. Text highlighted in color to show you exactly what the key points are. Special attention is placed on those four highly transferable skills, which grow stronger as you study Cups and Balls: Acting, Timing, Routing, and Misdirection. 

You’ll discover classic wand moves ever sleight-of-hand performer should know, opening positions and sequences, body sequences, secret loading sequences, as well as final rhythms that create the powerful misdirection to cover your final loads. Hardbound, full-color dust jacket.', '', '0')

[TEP STOP]

 

I Kdiff'd my categories.php with the one in the distribution and everything is where is should be. I have another contribution called "product cost" also in the file but I can't see where it should cause this error.

 

Looking at the error above I can see a problem: The short_desc "You’ll discover classic wand moves.." is following the products_description "'Over 750 photographs and 184 pages.." and is seperated by a space, but they are not seperated by the appropriate quote marks.

 

Any suggestions appreciated.

Link to comment
Share on other sites

Figured it out.

 

From the install instructions:

 

9/ ################## FIND ################//

		$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
		while ($description = tep_db_fetch_array($description_query)) {
		  tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "','" . tep_db_input($description['products_url']) . "', '0')");
		}

################ ADD AFTER ##################//

		$description_query = tep_db_query("select language_id, products_name, products_description, short_desc, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
		while ($description = tep_db_fetch_array($description_query)) {
		  tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, short_desc, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['short_desc']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
		}

 

I believe the instructions should read: REPLACE WITH, not ADD AFTER. Once I deleted the duplicate entry (the one without short_desc) everything was right with the world.

Edited by HSMagic
Link to comment
Share on other sites

  • 4 weeks later...

Hiya,

 

Been looking at this contrib.

 

Trying to see whether it will do what i need it to do.

 

I am making a store for model trains, however i would need to add what scale it is and have this listing in the products list.

 

However i would prefer to have it within a column, but if not then i could just use this and have it showing under neath the product name in the listings?

 

Hmm...

Link to comment
Share on other sites

Problem in my Products Expected@/admin/products_expected.php Admin panel:

Products Expected  

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

select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -20, 20

[TEP STOP]

 

How do I fix this? I followed the directions completely. Thanks

-Eric Schrader

Link to comment
Share on other sites

Problem in my Products Expected@/admin/products_expected.php Admin panel:

Products Expected  

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

select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -20, 20

[TEP STOP]

 

How do I fix this? I followed the directions completely. Thanks

Also, I'm using

Prod_descr_v_1.5 by Absinthe

-Eric Schrader

Link to comment
Share on other sites

Also, I'm using

Prod_descr_v_1.5 by Absinthe

Also, I just noticed I'm getting this error on multiple pages:

 

ADMIN PANEL ERRORS:

Reviews

Reviews  

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

select reviews_id, products_id, date_added, last_modified, reviews_rating from reviews order by date_added DESC limit -20, 20

[TEP STOP]

 

Specials

Specials  

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

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

[TEP STOP]

 

Products Expected

Products Expected  

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

select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -20, 20

[TEP STOP]

 

TOOLS

Newsletter Manager

Newsletter Manager  

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

select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from newsletters order by date_added desc limit -20, 20

[TEP STOP]

 

Please help me fix this wierd error, let me know what php files you need. THANKS again!

-Eric Schrader

Link to comment
Share on other sites

Hey there,

 

I just wanted to write and say thanks for this great contribution! I just installed and ran the sql command (a little shakey, but successful;)

 

Anyway, thanks a ton!

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Hi all,

 

The only bug in this fine contribution (it is the easiest to control and install out of similar contribs) is that it does not effect the products_new.php file.

 

Product Description 1.3 Contribution

 

The point of the contrib is to add a short product description in the product listings. It does this well for advanced search results and normal listings in categories.

 

Can anyone look at this code and try to advise me on how to implement it to also show on the products_new.php listings page.

 

Product Description 1.3 Contribution

 

Thank you kindly

 

 

Hey there,

 

I just installed and posted a thank you, but my store owner just pointed something out to me. She has entered <br> tags in her descriptions and the used to show. With the addition of this contrib, the line breaks no longer show. This is critical for her and her products....

 

Is there a way for this contrib to recognize the <br> tags in the product descriptions?

 

Thanks for any answers, no, yes, maybe???

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Hey there,

 

I just installed and posted a thank you, but my store owner just pointed something out to me. She has entered <br> tags in her descriptions and the used to show. With the addition of this contrib, the line breaks no longer show. This is critical for her and her products....

 

Is there a way for this contrib to recognize the <br> tags in the product descriptions?

 

Thanks for any answers, no, yes, maybe???

 

Adam

 

 

Hi everyone,

 

Can anyone offer any advice on this? This is what it looks like when I click on Test Category on my site...the line breaks are not honored....

http://goodfellasgames.com/index.php?cPath=200

 

And when you click on the actual product....the purple one that says Ned....the line breaks are honored....

 

Is there a way to preserve these breaks?

 

Thanks for advice:)

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Hi everyone,

 

Can anyone offer any advice on this? This is what it looks like when I click on Test Category on my site...the line breaks are not honored....

http://goodfellasgames.com/index.php?cPath=200

 

And when you click on the actual product....the purple one that says Ned....the line breaks are honored....

 

Is there a way to preserve these breaks?

 

Thanks for advice:)

 

Adam

 

 

Anybody? I will have to remove this contrib if I can't figure out how to retain the <br> tags...:(

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Anybody? I will have to remove this contrib if I can't figure out how to retain the <br> tags...:(

 

Thanks for the reply, I'll post in general help and see if anyone can offer any advice there....glad to hear you solved your issue:)

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Thanks for the reply, I'll post in general help and see if anyone can offer any advice there....glad to hear you solved your issue:)

 

I have received some help in the other forum and found a solution to preserving the <br> tags! Here's how to do it...

 

Basically, the contribution strips the HTML code from the product description before it displays the description summary.

 

Open:

catalog/includes/functions/general.php

 

Look for this code at the bottom: (you have added this when you installed the contrib)...

 

// short product description
function tep_flatten_product_description($description, $link)
{
$description = ereg_replace('<[^>]*>', '', $description);
if (strlen($description) > PRODUCT_LIST_DESCRIPTION_MAX_LENGTH){

$description = substr($description, 0, PRODUCT_LIST_DESCRIPTION_MAX_LENGTH);
$description .= "...".$link;
}else {
$description .= $link;
}
return $description;
}

 

Now simply comment out this line of code...insert the two forward slashes...(//) in front of it...

 

//$description = ereg_replace('<[^>]*>', '', $description);

 

Your code should look like this...

 

// short product description
function tep_flatten_product_description($description, $link)
{
//$description = ereg_replace('<[^>]*>', '', $description);
if (strlen($description) > PRODUCT_LIST_DESCRIPTION_MAX_LENGTH){

$description = substr($description, 0, PRODUCT_LIST_DESCRIPTION_MAX_LENGTH);
$description .= "...".$link;
}else {
$description .= $link;
}
return $description;
}

 

I hope this helps others!

 

Thanks for a great contribution too!

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

  • 2 weeks later...
I have received some help in the other forum and found a solution to preserving the <br> tags! Here's how to do it...

 

*knip*

 

I hope this helps others!

 

Thanks for a great contribution too!

 

Adam

 

Well it sure helpt me!

 

Thanks!

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

Well it sure helpt me!

 

Thanks!

 

Thanks Norman, I'm a strong believer in posting our solutions and not just asking questions all the time;)

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

  • 2 weeks later...

I installed this contribution today, tried it twice and anytime I click EasyPopulate from Catalog I get:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /../html/catalog/admin/easypopulate.php on line 659

 

 

Ive gone over the code, and with what little knowledge I have, I couldnt find anything wrong. This is lines 646-674:

 

if ($localfile){
	// move the file to where we can work with it
	$file = tep_get_uploaded_file('usrfl');			$attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id";

		$attribute_options_values = tep_db_query($attribute_options_query);

		$attribute_options_count = 1;
		//while ($attribute_options = tep_db_fetch_array($attribute_options_values)){
	if (is_uploaded_file($file['tmp_name'])) {
		tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
	}

	echo "<p class=smallText>";
	echo FILENAME ': ' . $localfile . "<br>";;

	// get the entire file into an array
	$readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $localfile);
}

// now we string the entire thing together in case there were carriage returns in the data
$newreaded = "";
foreach ($readed as $read){
	$newreaded .= $read;
}

// now newreaded has the entire file together without the carriage returns.
// if for some reason excel put qoutes around our EOREOR, remove them then split into rows
$newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded);
$readed = explode( $separator . 'EOREOR',$newreaded);

Edited by Joey_330ci
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...