Closed brunorodmoreira closed 5 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
faststore-site | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 26, 2024 8:06pm |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
What's the purpose of this pull request?
VTEX's Intelligent Search has a feature that allows convert any parameter to numeric, thus unlocking the ability to filter using ranges, just like price does. Although, the API's facet type field doesn't change the value, keeping it as "TEXT". The current StoreFacet resolver implementation only considers "RangeType" for values different from "TEXT", which restricts it to prices, that have the type "PRICERANGE" (reference: https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/facets/-facets-:~:text=Allowed%3A%20TEXT%E2%94%83PRICERANGE). This PR aims to unlock the ability to have another range filters in
ProductGallery
, then we can implement filters by dimension for example.Screenshots:
How it works?
I expanded the logic to set a facet as a range and change the filter component behavior to make it more generic, because currently it's specialized for prices. It keeps coupled to price component internally, but I think it's possible to evolve it after.
How to test it?
Set an attribute as numeric using Intelligent Search Settings and access a category that contains the facet.
Starters Deploy Preview
References