on my product page, where is the product description, it opens automatically, and I prefer the customer to do it himself, how can I disable it from opening automatically?
Topic summary
A user wants to prevent the product description accordion from opening automatically on their product page, preferring customers to expand it manually.
Proposed Solutions:
-
One responder suggests modifying the
product.liquidfile where the accordion code exists, noting that CSS changes may also be required. -
Another provides a detailed step-by-step solution:
- Navigate to Shopify Admin → Online Store → Themes → Actions → Edit code
- Locate
theme.liquidfile - Insert a JavaScript snippet above the closing
</body>tag that removes theopenattribute from collapsible elements on page load
Status: A code-based solution has been offered with implementation instructions. The discussion appears resolved pending the user’s implementation and confirmation.
There will be code in product.liquid for accordion. You can make change there. It needs some css change also to fix it.
How much do you take for this job, please?
Hello @Drawn
Please follow the steps below after logging into the Shopify admin:
-
Go to your Shopify Admin panel.
-
Click on Online Store > Themes.
-
Find the theme you want to edit and then click Actions > Edit code.
-
Search theme.liquid
-
Insert the provided Script code at the above of the closing of the body tag
SS : https://prnt.sc/Jf0KhwgE5cb5
<script>
document.addEventListener('DOMContentLoaded', function()
{
document.querySelectorAll('.product-tabs__tab-item-wrapper .collapsible')
.forEach(el => el.removeAttribute('open'));
});
</script>
Please hit Like and Mark it as a Solution if you find our reply helpful.
