Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Category tree on vtex legacy Filters and fixes url with the same page on Department Filters #179

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jovenan
Copy link

@jovenan jovenan commented Aug 5, 2023

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.

image

Use case:

https://www.austral.com.br/masculino?O=OrderByScoreDESC
https://australroupas.deco.site/masculino?O=OrderByScoreDESC

Fix description:

In the Department page like /masculino at austral, all filters come with the same current url. With this fix, this no longer happens.

Use case:

https://australroupas.deco.site/masculino?O=OrderByScoreDESC

if (mapSegments.length === 1) {
return `${url.pathname}${url.search}`;
}
// if (mapSegments.length === 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Should it be removed?

Copy link
Author

@jovenan jovenan Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this verification causes all top-level department pages to have their filters come with the same page url. You can check in this pages:

packs/vtex/loaders/legacy/productListingPage.ts Outdated Show resolved Hide resolved
packs/vtex/loaders/legacy/productListingPage.ts Outdated Show resolved Hide resolved
@jovenan
Copy link
Author

jovenan commented Aug 8, 2023

@lucis I have commited a new fixes to all points. Can you check?

@jovenan jovenan requested a review from lucis August 8, 2023 01:00
@jovenan
Copy link
Author

jovenan commented Aug 8, 2023

@lucis I made the adjustments you mentioned. You can verify?

packs/vtex/loaders/legacy/productListingPage.ts Outdated Show resolved Hide resolved
@@ -447,11 +447,6 @@ export const legacyFacetToFilter = (
const pathSet = new Set(pathSegments);

const getLink = (facet: LegacyFacet, selected: boolean) => {
// Do not allow removing root facet to avoid going back to home page
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line causes the aforementioned bug

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlgimenes I don't understand this comment, can you explain?
What would a fix for this look like?

this line of code in the verification makes all the returned filters have the wrong url when it is a department: https://australroupas.deco.site/masculino?O=OrderByScoreDESC

Co-authored-by: Tiago Gimenes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants