Closed michel334 closed 4 weeks ago
Hi,
Thanks for reporting we will take a look.
Hi @michel334 , thank you for the report. Could you, please, clarify if that happens on clean Magento or you use some specific theme as I cannot reproduce it on clean Magento installation. We did have such an issue on earlier version of the module, however, we now create new instance of \Magento\Catalog\Block\Product\ListProduct in our module so it is not supposed to overlap with the instance used on the category page.
Hi chaikovskyia, Thanks for checking. I have all themes disabled and the sorting problem persists. When i disable the stape module in Magento backend the sorting works as expected. I attached some more screenshots. The sorting is on the position field of the products attached to a categorie:
On the frontend when i click on the up/down arrow of sorting position, nothing happens with stape.io module enabled. When i disable the module the sorting works as expected. We have the latest version of the module (1.0.16)
I hope this clariefies the issue a bit. Kind regards, Michel
@michel334 , thank you for the details. I'll re-check it.
@michel334 , I still cannot reproduce the bug on clean Magento 2 installation. I see you use other third party modules, maybe some of the modules impacts the sorting behavior as well.
Hi chaikovskyia You are correct, there was another module that calls: public function afterGetLoadedProductCollection(\Magento\Catalog\Block\Product\ListProduct $subject, $resultCollection)
I added this code to that module, the same code that is in vendor\stape\gtm-server-side-magento-module\ViewModel\Category.php
/** @var \Magento\Catalog\Block\Product\ListProduct $productList */
$productList = $this->layout->createBlock(\Magento\Catalog\Block\Product\ListProduct::class);
$productList->getToolbarBlock()->setCollection($resultCollection);
The sorting is working correctly now thanks for your assistance.
You're always welcome ;)
The product listing sorting is not working when module stape/gtm-server-side-magento-module is active
stape/gtm-server-side-magento-module: version 1.0.16 Magento: 2.4.4-p9 Elasticsearch 7
stape plugin file which seems to create the problem \vendor\stape\gtm-server-side-magento-module\ViewModel\Category.php
public function prepareItems()
This call:
$collection = $productList->getLoadedProductCollection();
Messes up the sorting of the product categorie pages
Some relevant GitHub issues https://github.com/magento/magento2/issues/4132 Search for: ARGH! Kill me please...