Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add product desc. to product listings page...


Sarah_h

Recommended Posts

Posted

... so that I have (image) (product desc [100 chars]) (Price). Also would it be possible to concatenate the products description to about 100 chars and with a 'Read more>' which then takes the visitor to the product_info page? If so could someone give me some idea of where to begin with this. I'm ok with PHP so I'll give it a go.

 

Thanks

 

Sarah

Posted

There's a great Contribution that does this nicely. It's called Products Short Descriptions. Just search in the Contribs area from the link above. If you're good with php, adding the "Read More..." link should be a snap. When you do it, could you please pm that bit to me so I can add it? Every once in a while I get a customer who doesn't understand that they can click the name, or the image to go to the product's page.

Posted

Sarah,

I got the "Read More..." to work by adding this bit of code:

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

To the end of the display for the short description. Here's the whole bit:

		  // Products Description Hack begins
	  case 'PRODUCT_LIST_DESCRIPTION':
		$lc_text = '?' . osc_trunc_string(strip_tags($listing['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), PRODUCT_LIST_DESCRIPTION_LENGTH) . '?'.
		$lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . TEXT_READ_MORE . '</a><br>';
		$col_to_span = sizeof($column_list)-1;
		if (PRODUCT_LIST_IMAGE > 0) {
		  $col_to_span -= 1;
		}
		$lc_params = 'colspan="' . $col_to_span . '" ';
		break;
	  // Products Description Hack ends

I noticed there are actually several short description Contribs, so I don't know if this is the exact fit or not.

Archived

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

×
×
  • Create New...