Shopify themes, liquid, logos, and UX
can you please tell me how to auto close collapsible section for related product? picture attached for better understanding.
everything is under collapsible row and auto close except related products collapsible.
product page link
Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code
Step 2: Search file theme.liquid
Step 3: Insert this code above </body>
{% if template.name == 'product' %}
<script>
document.addEventListener("DOMContentLoaded", function() {
const summaryElement = document.querySelector("product-recommendations summary");
if (summaryElement) {
summaryElement.click();
}
});
</script>
{% endif %}
Hope it helps you 🙂
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
didn't worked sorry.
I hope it's before </body> not <head> ?
@SinghSells, yes before </body>, try again I've just updated the code 🙂
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
@SinghSells, if it still didn't work try this one
{% if template.name == 'product' %}
<script>
document.addEventListener("DOMContentLoaded", function() {
let interval;
interval = setInterval(()=>{
const summaryElement = document.querySelector("product-recommendations summary");
if (summaryElement) {
summaryElement.click();
}
},200)
setTimeout(()=>{clearInterval(interval)},3000)
});
</script>
{% endif %}
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
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024