Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
How do i move product description into collabsible row?
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
</head>
{% when 'custom-accordion' %}
<ul class="accordion">
{% if product.description != blank %}
<li class="accordion-item is-active">
<h3 class="accordion-thumb"><div><img src="{{ block.settings.plus | img_url: 'master' }}" class="acc_plus"/><img src="{{ block.settings.minus | img_url: 'master' }}" class="acc_minus"/></div>{{ block.settings.description_title }}</h3>
<h4 class="accordion-panel accordion-panel_des"> {{ product.description }}
<button class="acc_more">Read More:</button>
<button class="acc_less">Read Less:</button>
</h4>
</li>
{% endif %}
</ul>
$(function() {
// (Optional) Active an item if it has the class "is-active"
$(".accordion > .accordion-item.is-active").children(".accordion-panel").slideDown();
$(".accordion > .accordion-item").click(function() {
// Cancel the siblings
$(this).siblings(".accordion-item").removeClass("is-active").children(".accordion-panel").slideUp();
// Toggle the item
$(this).toggleClass("is-active").children(".accordion-panel").slideToggle("ease-out");
});
});
You can use this code for product collapsible description first you add block in schema name is "custom-accordion" then my code paste main-product.liquid before {% when 'price' %}
The best way is a new metafield for your products.
Create a metafield, which will be assigned for each product. In metafield create a structure same as your desired collapsible rows. Assign created metafield for products. For each product add data to the metafield. In collapsible rows section use dynamic source for each block.
Why move the description isn't good?
What if later you will need description + collapsible rows with different content?
I did that but how would i make some of the text bold?
Use a rich text type for each row_content value, inside your metafield definition. It will let you customize your text without code in future.
Target in CSS which you can bold element/text
like this:
.accordion-panel_des{
font-weight: 800;
}
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