Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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!
Solved! Go to the solution
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
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
ah you're the best! Thanks for responding so quickly - this worked a treat 🙂
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:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025