Allow category tree filters on vtex legacy filters#56
Conversation
|
This PR is the same of the STD PR: deco-sites/std#179 however without correcting the URL that returns the same page as this feature has already been corrected |
|
|
||
| // Get categories of the current department/category | ||
| const getCategoryFacets = (CategoriesTrees: LegacyFacet[]): LegacyFacet[] => { | ||
| const isDepartmentOrCategoryPage = !pageType; |
There was a problem hiding this comment.
yes, because if the page is not a departament or category, an error will occur. For example if the page is a search page, the pageType const will be undefined.
tlgimenes
left a comment
There was a problem hiding this comment.
I have mixed feelings about this one. The loader should "load" the data and it's up to the react component to filter it and render it. This implementation makes it impossible for someone to render other categories because the loader is filtering the data.
I'll accept since this loader may be deprecated in the future, but a nit would be to return all data an filter it on the frontend
Feature description:
This PR Allows the category tree filters to Vtex Legacy ProductListingPage. By sending to front the categories below the current department or category.
Use case:
https://www.austral.com.br/masculino?O=OrderByScoreDESC
https://australroupas.deco.site/masculino?O=OrderByScoreDESC