Hello @AdditivPlus To create a cascading filter system with dynamic metafield values and a search button on the Shop page in the Dawn theme, you’ll need to:
Key Features to Implement
- Three dropdowns:
. Brand (from metafield: product.metafields.custom.brand)
. Year (from metafield: product.metafields.custom.year)
. Model (product title or handle)
- Cascading logic:
. Brand → filters available Years.
. Year → filters available Models.
. “Search” button → filters and shows matching products.
- Values must be dynamically generated from the product catalog — no hardcoded options.
Overview of the Implementation Plan
-
Create a Section (or modify a template) to render the 3 dropdowns.
-
Collect metafields dynamically via JavaScript from products listed on the page (or fetched via Shopify’s Storefront API).
-
Use JavaScript to:
. Filter dropdown options based on the previous selection.
. Filter products once “Search” is clicked.
Suggested Implementation Approach
- Add Metafields to Your Products
Ensure the following metafields exist on each product in Settings > Custom data > Products:
. Namespace: custom
. Key: brand (single-line text)
. Key: year (single-line text)
- Create the Filter Block
In sections/main-collection-product-grid.liquid (or a custom section on the Shop page), add this HTML:
- Expose Product Metafields in Liquid
Below the product grid, expose the data in a JavaScript-readable way:
- Add JavaScript for Cascading Logic
Optional Enhancements
. Replace