-
-
Save projoomexperts/8888ad587081d9d9b3b1f380739e1b69 to your computer and use it in GitHub Desktop.
{% assign description = product.description | replace: '<h3', '</div><div class="tab-content"><h3' %} | |
<div class="prod_description"> | |
<div class="spacer"> | |
{{ description }} | |
</div> | |
</div> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> | |
<script> | |
jQuery(document).ready(function(){ | |
var tabTitle = '<ul>'; | |
jQuery('.prod_description > div.tab-content').each(function(i, item){ | |
jQuery(this).attr('id', "tabs-" + i); | |
var titletext = jQuery(this).find('h3').text(); | |
var titlelist = '<li><a href="#tabs-' + i + '">' + titletext + '</a></li>' | |
tabTitle += titlelist ; | |
}); | |
tabTitle += '</ul>'; | |
jQuery( tabTitle ).insertAfter('.spacer'); | |
jQuery('.spacer').remove(); | |
jQuery( ".prod_description" ).tabs(); | |
}) | |
</script> |
Hi I have and I've tried adding it to my product.liquid file as suggested but it still doesn't work for me. I've replaced up to {{ product.description | strip_html | json }} and just {{ product.description with your provided code and neither has created tabs I'm afraid. Here's a screenshot of the code.
Hi, Donot edit the product.liquid file for debut theme. For debut theme its inside /sections/product-template.liquid file.
Hi, Donot edit the product.liquid file for debut theme. For debut theme its inside /sections/product-template.liquid file.
Hello, thanks but after replacing the {{ product.description }} code within the /sections/product-template.liquid file. as suggested, this still hasn't worked for me. My site is https://marblewallpaper.co.uk/products/black-and-pink-waterproof-marble-vinyl-self-adhesive-wallpaper
@wesdoesdev
Your website has some javascript conflicts. To get the script working you need to solve them.
Hi I have and I've tried adding it to my product.liquid file as suggested but it still doesn't work for me. I've replaced up to {{ product.description | strip_html | json }} and just {{ product.description with your provided code and neither has created tabs I'm afraid. Here's a screenshot of the code.
