Skip to content

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:

@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?

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 <tlgimenes@gmail.com>
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