Product description tab opened when you come to the site

Solved

Product description tab opened when you come to the site

YounesTimitar
Explorer
155 0 19

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

YounesTimitar_0-1678789312733.png

 

 

But I want it like here, where the first tab (only the first one) is already opened when you come to the site.

YounesTimitar_1-1678789312738.png

 

 

Accepted Solution (1)
GemPages
Shopify Partner
5625 1262 1279

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

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center

View solution in original post

Replies 11 (11)

GemPages
Shopify Partner
5625 1262 1279

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

GemPages_0-1678847313273.png


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

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
YounesTimitar
Explorer
155 0 19

Hey,

Thanks for your awnser but it didnt work. Its still closed when I go to the product page.

 

YounesTimitar_0-1678897787902.png

 

GemPages
Shopify Partner
5625 1262 1279

Hi @YounesTimitar ,

 

You could please try adding the code before the </body> close tag (not <body> open tag) such as:

GemPages_0-1679305681252.png

 

Let us know how it works for you.

 

Best regards,
GemPages Support Team

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
YounesTimitar
Explorer
155 0 19

Hey,

Its still not working. I put it before the close body tag.

YounesTimitar_0-1679307510296.png

 

GemPages
Shopify Partner
5625 1262 1279

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

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
YounesTimitar
Explorer
155 0 19

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! 😄

GemPages
Shopify Partner
5625 1262 1279

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

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
YounesTimitar
Explorer
155 0 19

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

YounesTimitar_0-1679491076686.png

 

 

 

 

YounesTimitar_1-1679491076681.png

 

 

 

 

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. 

YounesTimitar_2-1679491076678.png

 

 

GemPages
Shopify Partner
5625 1262 1279

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

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
YounesTimitar
Explorer
155 0 19

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

 

YounesTimitar_0-1679570619966.png

 

YounesTimitar
Explorer
155 0 19

Hey, 

Are you still here? 😄