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

[Feature Request] Remember the order of applied multiselect filters on PLP #249

Open
mdevrees opened this issue Jan 29, 2025 · 0 comments
Open

Comments

@mdevrees
Copy link

Issue Brief

This issue serves as a feature request to remember the order in which multiselect filters were applied on the PLPs layered navigation.

The selection of filters get appended to the url, example ?colors[0]=red&colors[1]=grey. I would assume this order would be kept, but that appears to not be the case:

Image

I would like to see this feature because we have logic that displays a different product image on the PLP based on the most recently activated (color) filter.

Technical details

I decided to dig a little deeper and it looks like the filter order is not kept in the init \Tweakwise\Magento2Tweakwise\Model\Catalog\Layer\FilterList\Tweakwise::initFilters

            $filter = $this->filterFactory->create(
                [
                    'facet' => $facet,
                    'layer' => $layer,
                    'attribute' => $attribute
                ]
            );

In order to init the filter, facets are retrieved from the attributes and these determine the sort order of active filters.

In the future, would it be possible to keep the applied multiselect filter sort order applied?

Environment

  • PHP Version: 8.2
  • Magento Version: 2.4.6-p8
  • Tweakwise Version: 8.2.0
  • Tweakwise Hyva version: 4.2.0
  • Tweakwise Export Version: 7.2.1
  • Magento Deploy Mode: development
  • Third party modules:
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

No branches or pull requests

1 participant