Have a Magento 2 installation with multiple stores
Make an attribute landing page based on a category and tweakwise filter
Set the store id of the landing page to one of the stores
Go to the store that is NOT set on the landing page
On the category page click on the filter that you set up in the landing page
Result:
The FilterManager finds the landing page, changes the filter url to the landing page url and when you click it, you see the 404 page
Expected result:
For the current store there is no attribute landing page set up, so just add the filter to the url as a regular filter.
Probable cause:
The urls of the filters are fetched with this code:
if ($url = $this->urlFinder->findUrlByFilters($filters, $layer->getCurrentCategory()->getEntityId())) {
return $url;
}
What is missing here is that the store id also matters when finding urls. The UrlFinder mentioned in the code is from https://github.com/EmicoEcommerce/Magento2AttributeLanding. The UrlFinder currently also does not accept a parameter for the store id, but I think that it should, for this case specifically.
This is an issue that also needs to be solved in https://github.com/EmicoEcommerce/Magento2AttributeLanding
Steps to reproduce:
Result: The
FilterManager
finds the landing page, changes the filter url to the landing page url and when you click it, you see the 404 pageExpected result: For the current store there is no attribute landing page set up, so just add the filter to the url as a regular filter.
Probable cause: The urls of the filters are fetched with this code:
What is missing here is that the store id also matters when finding urls. The
UrlFinder
mentioned in the code is from https://github.com/EmicoEcommerce/Magento2AttributeLanding. TheUrlFinder
currently also does not accept a parameter for the store id, but I think that it should, for this case specifically.