filtering-system

Define server-side and client-side filtering architecture for product lists.

1.5k|875|Updated Aug 20, 2021
One-click install
npx skills add https://github.com/saleor/storefront --skill filtering-system
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filtering-system
Source: https://github.com/saleor/storefront/tree/main/.claude/skills/filtering-system
Command: npx skills add https://github.com/saleor/storefront --skill filtering-system

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Product lists often require complex filters that span server-side data fetching and client-side presentation. This Skill provides a coherent architecture to define, implement, and reason about filtering and sorting for category, price, and attribute-based filters on e-commerce storefronts.

Core Features & Use Cases

  • Filter Architecture: server-side categories, price, and sort; client-side colors and sizes.
  • Server-Side Filtering: category slugs are resolved to IDs and used in queries.
  • Client-Side Filtering: post-fetch refinement using color/size options and local helpers.
  • Use Case: implementing category pages with dynamic filtering and responsive UI.

Quick Start

Implement server-side filtering with ProductFilterInput and ProductOrder, then enable client-side filtering with useProductFilters and the PLP components.

Frequently Asked Questions about filtering-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement product filtering for e-commerce category pages?

Product filtering for category pages is implemented through a shared architecture handling server-side category resolution, price filtering, and sort orders, alongside client-side refinements for attributes like color and size.

What is the best way to handle server-side and client-side product list filtering together?

Server-side and client-side product list filtering is unified by resolving category slugs to IDs for server queries, then applying post-fetch client-side refinements using local helpers for attributes like color and size.

How do I resolve category slugs to IDs for GraphQL product filtering?

Category slugs are resolved to IDs during server-side filtering and used in GraphQL queries via ProductFilterInput, ensuring the correct product lists are fetched before applying client-side UI refinements.

Can I use client-side filtering for product attributes like color and size after fetching data?

Yes, client-side filtering for product attributes like color and size is supported through post-fetch refinement using local helpers and UI hooks, allowing dynamic product list updates without additional server requests.

Does this filtering architecture work for both collection and category pages?

Yes, the unified filtering architecture applies to category, collection, and product pages, providing a coherent structure to define, implement, and reason about sorting and filtering across e-commerce storefronts.

What components are needed to build a responsive product filtering UI?

Building a responsive product filtering UI requires using ProductFilterInput and ProductOrder for server-side data fetching, then enabling client-side interactions with useProductFilters and PLP components.