You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we visit a virtual category page and then visit a product page of a product that doesn't belong to the last visited virtual category, we will see the virtual category page of the last category visited in the breadcrumbs instead of "home" -> "product name". When searching products we should not see categories on breadcrumbs.
Preconditions
Replicable in every env. Using M1 chip with valet for PHP and Nginx and docker for redis, Open search, and database
But this issue also happens on smile/elasticsuite 2.10.18.1
Environment : Reproducible in both modes
Third party modules : None seem to impact this feature directly.
Steps to reproduce
Create a virtual category with some products and visit it
Go to another product that doesn't belong to this virtual category
Check the category of the breadcrumbs, it will show the virtual category as it was the last category visited.
Expected result
When searching for products we should not see categories on breadcrumbs.
Actual result
We see the Virtual category of this product
The is where the issue happens. Basically, since the last visited category is a virtual, this plugin will return true.
\Smile\ElasticsuiteVirtualCategory\Plugin\Catalog\ProductPlugin::aroundCanBeShowInCategory
Then this line is evaluated to true vendor/magento/module-catalog/Helper/Product.php:446 which will set the categoryID to the virtual category.
Ultimately the this line sets the wrong product category to the product
My solution for this was an after plugin to Magento\Search\Controller\Ajax\Suggest:afterExecute setting
$this->catalogSession->setLastVisitedCategoryId(null);
When we visit a virtual category page and then visit a product page of a product that doesn't belong to the last visited virtual category, we will see the virtual category page of the last category visited in the breadcrumbs instead of "home" -> "product name". When searching products we should not see categories on breadcrumbs.
Preconditions
Replicable in every env. Using M1 chip with valet for PHP and Nginx and docker for redis, Open search, and database
Magento Version : 2.4.5-p3
ElasticSuite Version: smile/elasticsuite 2.10.13.3
But this issue also happens on smile/elasticsuite 2.10.18.1
Environment : Reproducible in both modes
Third party modules : None seem to impact this feature directly.
Steps to reproduce
Expected result
Actual result
The is where the issue happens. Basically, since the last visited category is a virtual, this plugin will return true.
\Smile\ElasticsuiteVirtualCategory\Plugin\Catalog\ProductPlugin::aroundCanBeShowInCategory
Then this line is evaluated to true vendor/magento/module-catalog/Helper/Product.php:446 which will set the categoryID to the virtual category.
Ultimately the this line sets the wrong product category to the product
vendor/magento/module-catalog/Helper/Product.php:461
The text was updated successfully, but these errors were encountered: