Open vshatylo opened 4 months ago
@vshatylo The problem with this is that magento doesn't know which filters exists in TW and which filters are hidden filters.
Do you have an suggestion how to determine which filter should be applied and which not?
i was thinking about 2 ways
@vshatylo
Solution 1 has the problem that you can't detect which filter you just deactivated if you use all url params. Than the deactivated filter just gets activated again.
Solution 2 could work. But filter templates can differ for categories. You can determine if an filter is an hidden filter, but it can be an hidden filter in an different filter template than the current category.
I'll discuss this internally and see if we can come up with an solution for this.
@vshatylo Is there an reason that you don't use the ALP module for this? You can enable hidden filters there, and an ALP works on an specific url
@vshatylo Is there an reason that you don't use the ALP module for this? You can enable hidden filters there, and an ALP works on an specific url
Expected result the results should be the same: despite of whether it's rendered by AJax or not.
now it works differently
@vshatylo Then the bug is (in my opinion) that you can set an hidden filter via the url (?hidden_filter=test).
So if you want to use an hidden filter, you can use an ALP page. And otherwise if the hidden filter is in the url. It should not change the product selection on the first page.
To fix this issue you have two options
- apply all filters that are in the URL when building Ajax requests. in this case, hidden param are not lost during Ajax filtering. Tweakwise anyway ignores filters that are not in the filter template.
- sync filter templates with Magento. Tweakwise allows us to get information about filter templates by API. Then we could determine which filters are hidden.
But both options have problems
Solution 1 has the problem that you can't detect which filter you just deactivated if you use all url params. Than the deactivated filter just gets activated again.
Solution 2 could work. But filter templates can differ for categories. You can determine if an filter is an hidden filter, but it can be an hidden filter in an different filter template than the current category.
@jansentjeu Can I get your input on this? I don't think both solutions are good options to fix this problem.
@vshatylo There are currently no plans to fix this. This is due to the low impact of this issue, and not having good solution for this problem. This problem only occurs if you know the values for an hidden filter, and add them to the url yourself.
Issue Brief
Tweakwise allows setting the filter as "hidden|not to show" in the filter template but filtering by it is still workable. Such filters could be used for marketing to point users to special products.
Environment
PHP Version: 8.1 Magento Version: 2.4.6 Tweakwise Version: 5.7.3 Tweakwise Export Version: 5.4.0 Magento Deploy Mode: production
Pre-conditions
Steps to reproduce
Actual result
Expected result