Show more/less description tweaking

Tourist
4 0 1

Hi!

 

This is my website: hifiaruhaz.hu pass: neovo

 

I would like to add this script to my website https://jadepuma.com/blogs/blog/more-less-toggles-for-shopify-descriptions 

After placing the code, the description duplicates below the original one. Could someone point me on the right track?

 

I really appreciate any help!

 

Thanks.

1 Like
Excursionist
15 0 2

Hello recarta,

I am not sure if this is the best way to resolve this but I found by modify the code as shown below it worked.

 

{% if product.description.size > 200 %}
<div class="product-description-short">
{{ product.description | truncate: 100, ". . . " }}<a class="readmore" href="#">Show More &#62;</a>
</div>
<div class="product-description-full" style="display:none;">
{{ product.description }}
<br><a class="readless" href="#">&#60; Show Less</a>
</div>
{% else %}

{% endif %}

 

0 Likes