Shopify themes, liquid, logos, and UX
Hi!
We have detailed product descriptions for each of our items, and while I've tried to shorten them, they still end up being quite lengthy. We believe it would be beneficial for the customer experience if we could include an option to "read more" or something similar, allowing them to view the full description if they choose.
Would you be able to assist us with this?
Looking forward to hearing from you!
Best regards,
Hi @BellaMil ,
To implement a "read more" option for lengthy product descriptions in Shopify, follow these steps:
Edit the Product Template:
Locate the Product Template:
Wrap the Description: Find the section displaying the product description. It might look like this:
{{ product.description }}
Replace it with:
<div class="product-description">
<div class="description-collapsible">
{{ product.description }}
</div>
<button class="toggle-description" onclick="toggleDescription()">Read More</button>
</div>
Add CSS for Collapsible Effect: In your base.css or style.css file, add:
.description-collapsible {
max-height: 100px; /* Adjust based on your preference */
overflow: hidden;
transition: max-height 0.3s ease-out;
}
.description-collapsible.expanded {
max-height: none;
}
.toggle-description {
background: none;
border: none;
color: #007bff;
cursor: pointer;
margin-top: 10px;
}
Add JavaScript: In your theme.liquid file (just before the </body> tag), add:
<script>
function toggleDescription() {
const description = document.querySelector('.description-collapsible');
description.classList.toggle('expanded');
const button = document.querySelector('.toggle-description');
button.textContent = description.classList.contains('expanded') ? 'Read Less' : 'Read More';
}
</script>
save and review .
Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.
Thanks & Regards
Akshay Bhatt
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025