Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I was wondering how I can change to product description tab to autmatically be opened when you come on the site?
Right now when you come on the site, the first product description tab is closed and yu have to manually open it
But I want it like here, where the first tab (only the first one) is already opened when you come to the site.
Solved! Go to the solution
This is an accepted solution.
Hi @YounesTimitar ,
I can't find the code that you add in the theme code.
You could please try adding the below code before </body> close tag in the theme.liquid
<script>
(function() {
setTimeout(function(){
let productMeta = document.querySelector('.product-single__meta');
let firstTabElement = productMeta.querySelector('.product-block--tab').firstChild;
firstTabElement.querySelector('.collapsible-trigger').click()
},500)
})();
</script>
You could please don't remove the code if it still doesn't work. Then I can check the cause of why it doesn't work.
Best regards,
GemPages Support Team
Hello @YounesTimitar ,
It's the GemPages Support Team and we are glad to assist you today!
I would like to give you the recommendation to support you so kindly follow the steps below:
1. Go to Online Store > Theme > Edit code of your current theme
2. Open your theme.liquid theme file
3. Paste the below code before </body>
<script>
(function() {
let productMeta = document.querySelector('.product-single__meta');
let firstTabElement = productMeta.querySelector('.product-block--tab').firstChild;
firstTabElement.querySelector('.collapsible-trigger').click()
})();
</script>
Let us know how it works for you.
Best regards,
GemPages Support Team
Hey,
Thanks for your awnser but it didnt work. Its still closed when I go to the product page.
Hi @YounesTimitar ,
You could please try adding the code before the </body> close tag (not <body> open tag) such as:
Let us know how it works for you.
Best regards,
GemPages Support Team
Hey,
Its still not working. I put it before the close body tag.
Hi @YounesTimitar ,
Could you share the page URL that has the accordion? Then I can see and suggest something for you.
Best regards,
GemPages Support Team
Hey,
What do you mean with accordion?
I want it on every product page, so there is no specific link.
Here is the URL for the website, but as I said the problem is on every product
https://timitar.de/collections/alle-gewurze
Thank you very much! 😄
This is an accepted solution.
Hi @YounesTimitar ,
I can't find the code that you add in the theme code.
You could please try adding the below code before </body> close tag in the theme.liquid
<script>
(function() {
setTimeout(function(){
let productMeta = document.querySelector('.product-single__meta');
let firstTabElement = productMeta.querySelector('.product-block--tab').firstChild;
firstTabElement.querySelector('.collapsible-trigger').click()
},500)
})();
</script>
You could please don't remove the code if it still doesn't work. Then I can check the cause of why it doesn't work.
Best regards,
GemPages Support Team
Wow it worked, thank you very much!!!!!!! 😄
I have another issue that you can please help me with 😄
So I have one product with only 0.5 g (weight) but all the time it shows for 1g. Every other product the weight is over 1g and it shows correct but only for this one its 0.5g but shows 1 g
I already asked my theme developer and they said that it has something to do with this code snippet a member of the shopify community changed for me. But they wont help me cause its not handle stuff like this.
Hi @YounesTimitar ,
I am glad that my solution is helpful to you.
About the new question, could you please attach larger images? Now, they are very small so I can't view the detail.
Let us know how it works for you.
Best regards,
GemPages Support Team
Hi,
So basically the problem is that I have a product which weight is 0.5g (its a low weight), but when I enter the weight 0.5 g for the product shopify rounds it up to 1g. So I need this product https://timitar.de/collections/alle-gewurze/products/safran-1 to show 0.5g instead of 1g
Hey,
Are you still here? 😄
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025