All things Shopify and commerce
This is a Figma file. Filters are being applied in it, and I have created such a structure where different products will be in each tab. I want filters to work in my tabs. If you can provide me with the code, I would be very grateful. I will send you a screenshot.
This would be a basic example:
document.addEventListener("DOMContentLoaded", function() { const tabs = document.querySelectorAll(".tab"); const tabContents = document.querySelectorAll(".tab-content"); const filters = document.querySelectorAll(".filter"); // Hide all tab contents except the first one tabContents.forEach((content, index) => { if (index !== 0) { content.style.display = "none"; } }); // Event listeners for tabs tabs.forEach(tab => { tab.addEventListener("click", function() { const tabId = this.getAttribute("data-tab"); tabContents.forEach(content => { if (content.id === tabId) { content.style.display = "block"; } else { content.style.display = "none"; } }); }); }); // Event listener for filters filters.forEach(filter => { filter.addEventListener("change", function() { // Implement filtering logic here }); }); });
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025