So once again i can’t find the answer and would love to recieve help from the more experienced e-commerce expers or web designers, i can’t figure out how i can add “read more” & “read less” button on product page if the description is too long and theyre not interested in reading it.
To add a “read more” link to a Shopify product description, you will need to do the following:
Go to your Shopify store’s admin panel and navigate to the product page for the product you want to edit.
Scroll down to the “Description” field and click on the “HTML” button to switch to the HTML editor.
Find the point in the description where you want the “read more” link to appear. You can use the “Preview” button to see how the description looks on the front end of your store.
Insert the following code at the point where you want the “read more” link to appear:
Read more
Add a “Read less” link below the content you want to show when the “Read more” link is clicked. You can do this by adding the following code:
Read less
Wrap the content you want to hide with the “read-more-content” class. You can do this by adding the following code:
Add the following CSS to your theme’s stylesheet to style the “Read more” and “Read less” links and to hide the content by default:
Add the following JavaScript to your theme’s JavaScript file to toggle the “Read more” and “Read less” links and to show/hide the content when they are clicked:
To add a “read more” and “read less” button to a product page in Shopify, you will need to modify the product template in your Shopify theme. To do this, you will need to have some familiarity with HTML, CSS, and Liquid, the template language used by Shopify.
Here’s an example of how you could add a “read more” and “read less” button to a product page:
First, you will need to add the following HTML to your product template, replacing {{ product.description }} with the Liquid tag that outputs the product description:
{{ product.description }}
This will create a container for the product description and a button that says “Read more”.
Next, you will need to add some CSS to your theme to hide the part of the description that you want to toggle. You can do this by adding the following CSS to your theme’s stylesheet:
Finally, you will need to add some JavaScript to your theme to toggle the visibility of the hidden content when the “Read more” button is clicked. You can do this by adding the following JavaScript to your theme’s JavaScript file:
This code will listen for a click event on the “Read more” button, and toggle the expanded class on the description container. The expanded class should have a style that sets the max-height of the container to none, so that the entire description is visible.
If you need any help with above please DM me I will be more than happy to help