WP e-Commerce Product Excerpt

If you are like me, you have some clients whom have some product descriptions that are very long and others that are very short. I personally did not like the way wp e-commerce simply just displayed the full description, making each product default page look in my option unprofessional. To solve this issue, I modified the wp e-commerce theme to display a 50 word excerpt of the full description.

Note: Remember to make a copy of any wp e-commerce theme to your WordPress theme. There is a simple move tool under the Presentation tab of the store settings to make this easy. NEVER modify the default theme in wp e-commerce theme due any updates made to wp e-commerce will overwrite the work you have done.

What you will want to do is copy the wp-products_pages.php file to your theme. Download it to your computer so you may edit it. Go to line 106 (shown below)

<div class="wpsc_description">
<?php echo wpsc_the_product_description(); ?>
</div><!--close wpsc_description-->


Make the following change:

<div class="wpsc_description">
$fulldesc = wpsc_the_product_description();
$prodexcerpt = implode(' ', array_slice(explode(' ', $fulldesc), 0, 50));
echo $prodexcerpt;
</div><!--close wpsc_description-->

About Joe

Hi. I am a web designer and front end developer located in Muskegon Mi. I specialize in helping small and medium size businesses succeed online.
This entry was posted in Web Design Tips. Bookmark the permalink.

Comments are closed.