Collections: Add a product description excerpt below the title and price

Note:
Groupthought does not provide any warranty or further support for this code. Use this code at your own risk. The code provided below is only a suggestion. You are responsible for any and all code customizations made to your theme. Please work with a developer or Shopify Expert to ensure proper customization. This code may not work with all versions of of Pipeline or with other code customizations and apps you may have installed. We strongly recommend that you make duplicate of your theme before adding or changing any code in your theme.
This tutorial is intended for use with the Pipeline theme.

Example:

Code:

<p>{{ product.description | strip_html| truncatewords: 10 }}</p>

You can adjust the value of how many words. Example of 15 would be:

<p>{{ product.description | strip_html| truncatewords: 15 }}</p>

How to:

Always make a duplicate of your theme before adding any code. This will save you if anything goes wrong or if you decide not to use the added code in the future. We can not support or be responsible of any code changes that you make to your theme. For that reason, save yourself and make a duplicate first.

Make a duplicate before any code changes:

Next, open the Code Editor:

From your list of themes, find the Actions link for the theme you'd like to edit. Then select Edit code. Example draft theme:

Example if you're working from your main live/published theme:

Quick link if the theme is live/published:
Open Code Editor

From the Snippets folder on the left, open product-grid-item.liquid:

Towards the bottom of the file on the right, look for this line:

We're going to add about three blank lines before that closing </a> line:

Now, paste the code in that spot, after the closing </p> and before the closing </a>:

The code to use again is:

<p>{{ product.description | strip_html| truncatewords: 10 }}</p>

Save the file. 

Adjust the truncatewords value to a number you like. 


Undo

Use the Older versions link at the top of the file if you need to rollback or undo this code change.