Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Description 1.3


Guest

Recommended Posts

There is an extra coma in your sql query that causes the problem

 

select p.products_image, pd.products_name, pd.products_description,,

 

try to remove it and see if there other errors.

Link to comment
Share on other sites

  • Replies 297
  • Created
  • Last Reply

Top Posters In This Topic

Hi and thanks again for you help.

 

I didn?t find "pd.products_description,," although if I remove the last coma from 'pd.products_name, pd.products_description,'; below I don?t get the error message, but the contribution still don?t work.

 

####[ FIND, 153-154 ]#########################################################

 

case 'PRODUCT_LIST_NAME':

$select_column_list .= 'pd.products_name,';

 

####[ REPLACE WITH ]##########################################################

 

case 'PRODUCT_LIST_NAME':

$select_column_list .= 'pd.products_name, pd.products_description,';

 

 

I also noticed that i don?t have commas after each line like in the above instruction:

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

switch ($column_list[$col]) {

 

case 'PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model';

 

break;

 

case 'PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, pd.products_description';

 

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;

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

 

Anyone encountered this problem before?

Link to comment
Share on other sites

  • 4 weeks later...

I installed the code for the short desc. to appear in the shopping cart... but no go. :( It doesn't show up.

 

I'm guessing this is because I'm using v2 and the PRODUCTS_DESCRIPTION table and not the PRODUCTS table? Is there a work-around to get the Short Desc. in the shopping cart for v2 of Josh's code?

 

Any help would be greatly appreciated :D

Link to comment
Share on other sites

  • 2 weeks later...

in the introduction

FILES TO EDIT (1):

 catalog /products_new.php

####[ OPEN ]##################################################################

 catalog /products:new.php	


####[ FIND ]#############################################################

$products_new['products_description'] . 

####[ REPLACE WITH ]##########################################################

tep_flatten_product_description($products_new['products_description'],  ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . TEXT_MORE . '</a>') .

but i have only a includes/modules/products_new an there told

<tr>
<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new_array[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new_array[$i]['image'], $products_new_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new_array[$i]['id']) . '"><b><u>' . $products_new_array[$i]['name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . $products_new_array[$i]['date_added'] . '<br>' . ' ' . ' ' .  $products_new_array[$i]['manufacturer'] . 'Um Preise zu sehen bitte auf "Mehr infos" oder das Produkt klicken.<br><b>' . TEXT_PRICE . ' ' . $products_price; ?></b>inkl. gesetzl. MwSt. zzgl. Versand</td>
<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $products_new_array[$i]['id']) . '">' . tep_image_button('button_info.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
 </tr>

 

Where i put the code?

Edited by manica
Link to comment
Share on other sites

  • 2 weeks later...

Hi and thanks for this helpfull contribution!!

 

I saw a reply to this post ...

 

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=690696

 

... who shows how to add the short description to the file catalog/inludes/modules/new_products.php, I followed the instructions but there is an error:

 

New Products For January

1054 - Unknown column 'p.short_desc' in 'field list'

 

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 products p left join specials s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit 5

 

[TEP STOP]

 

Any suggestion?? Ciao. Medusacross

Link to comment
Share on other sites

hey,

I've gone through every step of installation twice, both times I get the following message when I go to my site:

 

Parse error: parse error, unexpected T_FUNCTION in /home/silkspla/public_html/test/includes/functions/general.php on line 1260

 

This is how the end of my general.php file looks...

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;
  }
?>

 

Help would be very much appreciated. Thanks.

Link to comment
Share on other sites

I just added V2.1 to my site. I added short_desc to Table_Products. When I go to the product descriptions in the Catalog admin the Short Description field is there. How do I get the Short Description to appear in the actual product listing on the website? I don't see any option to "turn it on" within the Product Listing admin or anywhere else. What am I missing.

 

I added a short description to this product for testing: http://laughingblenny.com/index.php?cPath=28

 

Thanks.

Link to comment
Share on other sites

I just added V2.1 to my site. I added short_desc to Table_Products. When I go to the product descriptions in the Catalog admin the Short Description field is there. How do I get the Short Description to appear in the actual product listing on the website? I don't see any option to "turn it on" within the Product Listing admin or anywhere else. What am I missing.

 

I added a short description to this product for testing: http://laughingblenny.com/index.php?cPath=28

 

Thanks.

 

 

BUMP

Link to comment
Share on other sites

I've just posted updated version of Product Description.

 

It's working well for products_new too, just make sure you don't confuse yourself by installing other, similar contributions. :thumbsup:

 

Alex

 

Hi Alex,

 

I just installed your contribution and it seems to be working okay. The only issue I am having is trying to modifiy the Stylesheet (I am far from an expert). I've tried changing the font sizes and I tried changing colors, but it does seem to change on the store page.

 

Can you point me to a fix?

 

Thanks.

 

TD.productDesc {
 font-family: Verdana, Arial, sans-serif;
 font-size: 6px;
 color: #808080;
 padding: 1px 7px 1px 7px;
}

TD.productheadDesc {
font-family: Verdana, Arial, sans-serif;
font-size: 20px;
font-weight: normal;
color: #000000;
padding: 4px 0px 0px 10px;
}

 

http://laughingblenny.com/index.php?cPath=30

Link to comment
Share on other sites

Those two classes control product describtion on products_new as well as on product_listing.php. If you want a different look for products_new for example, you need to create new class for it in stylesheet a call it from products_new. You can also change class="main" to whatever you like.

 

Alex

Absinthe Original Liquor Store

Link to comment
Share on other sites

Hi installed the latest contrib and worked pefectly, descriptions are show..great!

 

2 things I have a query with

 

I dont use products_new I use featured products insted.

 

I tried just replacing the follow (in featured_products)

 

<tr>

<td rowspan="2" width="<?php echo SMALL_IMAGE_WIDTH; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $FEATURED_PRODUCTS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $FEATURED_PRODUCTS['products_image'], $FEATURED_PRODUCTS['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td class="productheadDesc" align="left" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $FEATURED_PRODUCTS['products_id']) . '"><b>' . $FEATURED_PRODUCTS['products_name'] . '</b></a>'; ?></td>

<td class="main" align="right" valign="top"><?php echo '<b>' . $products_price . '</b> '; ?></td>

</tr>

<tr>

<td class="productDesc" align="left" valign="top" class="main" colspan="2"><?php echo tep_flatten_product_description($FEATURED_PRODUCTS['products_description'], ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $FEATURED_PRODUCTS['products_id']) . '">' . TEXT_MORE . '</a>') . '<br><b>' . TEXT_DATE_ADDED . ' ' . tep_date_long($FEATURED_PRODUCTS['products_date_added']) . '</b>'; ?></td>

</tr>

<tr>

<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?></td>

</tr>

 

 

I tried just doing a find and replace in your install file for products_new and replacing with featured_products but it did not work.

 

 

 

Also when I select a manufacturer I dont see the product descriptions

 

Any help on these 2 would be great...

 

works on all other areas on site, and very pleased with it.. esp as did not have to type any of the desriptions up they just showed up automaticly..

Link to comment
Share on other sites

I installed this on CRE Loaded 6.15, and it doesn't seem to change anything at all. A couple of files are different (ie certain functions and code are in differing files due to templates, etc.), but i think i got them all in the right places.

 

Does anyone have any suggestions? Or has anyone had this work on CRE? THanks!

Link to comment
Share on other sites

  • 2 weeks later...

Hi, i've installed the latest version of this contribution. It works great everywhere but on the new_products box. In this box, i have three rows for each product, the 1st one with no description, the 2nd one with the description in one language, and the 3rd one with the description in another language. Here is the query in new_products.php:

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, pd.short_desc, p.products_image, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.categories_id not in ('26','2','3') and p.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, pd.short_desc, p.products_image, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . 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);

}

 

anyone can figure out the problem?? thx

Link to comment
Share on other sites

  • 2 weeks later...

This is a great contribution. The only problem is that when it strips out line breaks my words end up right next to each other

i,e product.This

Is there a way to have it replace the stripped out code with a space?

 

Thanks in advance

Link to comment
Share on other sites

The contribution installed great.. However, I noticed that it always has to be shown underneath the Product Name. I've tried to mix and mingle with product_listing.php, but nothing seems to really work out of it - at least with my knowledge and skill level.

 

For my site, we are using a list view mode and have incorporated it, however, we would like the Manufacturer Name and also the price right underneath the Product Name before it hits the description. Below is a photo provided as an example mocked up in Photoshop:

 

example.gif

 

Any type of assistance is greatly appreciated. A big thank you in advance!

Edited by mr_dimsum
Link to comment
Share on other sites

i'm having some problems with this.. i am getting conflicts with some of my existing code.. can anybody propose a solution? below is enigma1's suggested coding to use the short description on the new_products.php page.. at the bottom is mine pulled from new_products.php.

 

  $products_new_query_raw = "select p.products_id, pd.products_name, pd.short_desc, 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";

 

I just added the pd.short_desc after the pd.products_name. The pd table is defined and points to TABLE_PRODUCTS_DESCRIPTION.

 

my code:

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

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