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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024