Tab open by default on Impulse Theme

Solved

Tab open by default on Impulse Theme

HelenVAC
Tourist
6 0 2

UPDATE: SOLUTION FOUND! Thanks to everyone who responded so fast 🙂

 

Hello! Would love some help with coding, please.

How do I make the first tab open by default on my product page? My website theme is Impulse. I'm not confident with which code to edit - please help!

 

Screenshot 2024-09-30 144533.png

Accepted Solution (1)

BSSCommerce-B2B
Shopify Partner
1723 513 577

This is an accepted solution.

@HelenVAC,
Step 1: Go to Admin -> Online store -> Theme > Edit code

Step 2: Search for the file theme.liquid

Step 3: Add this code before </body> tag

 

<script>
document.addEventListener("DOMContentLoaded", (event) => {
  const firstTab = document.querySelector(".product-block--tab .collapsibles-wrapper:first-child > button");
  if (firstTab) {
    firstTab.click()
  }
});
</script>

 

If it helps you, please like and mark it as the solution.

Best Regards 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

Replies 3 (3)

BSSCommerce-B2B
Shopify Partner
1723 513 577

This is an accepted solution.

@HelenVAC,
Step 1: Go to Admin -> Online store -> Theme > Edit code

Step 2: Search for the file theme.liquid

Step 3: Add this code before </body> tag

 

<script>
document.addEventListener("DOMContentLoaded", (event) => {
  const firstTab = document.querySelector(".product-block--tab .collapsibles-wrapper:first-child > button");
  if (firstTab) {
    firstTab.click()
  }
});
</script>

 

If it helps you, please like and mark it as the solution.

Best Regards 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

HelenVAC
Tourist
6 0 2

ah you're the best! Thanks for responding so quickly - this worked a treat 🙂

Moeed
Shopify Partner
5420 1463 1750

Hey @HelenVAC 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

 

<script>
document.addEventListener("DOMContentLoaded", function() {
  var firstCollapsibleButton = document.querySelector('.collapsible-trigger');
  var firstCollapsibleContent = document.querySelector('.collapsible-content');

  if (firstCollapsibleButton && firstCollapsibleContent) {
    firstCollapsibleButton.setAttribute('aria-expanded', 'true');
    firstCollapsibleContent.style.height = 'auto';
  }
});
</script>

 

RESULT:

Moeed_0-1727682474622.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

 

- Need a Shopify Specialist? Chat on WhatsApp

- Custom Design | Advanced Coding | Store Modifications