tuyennn / magento2-outofstockatlast

Magento 2.4.x module Sort Out Of Stock Product At last the product list
GNU General Public License v3.0
55 stars 12 forks source link

Sort by Position of products not working on category page #22

Closed PiroozMB closed 2 years ago

PiroozMB commented 2 years ago

after installing the extension , sorting products by position are not working anymore on category pages. I got this once working in magento 2.2.3 in ListProduct.php using this code: $collection->addExpressionAttributeToSelect('in_stock', 'IFNULL(stock_status_index.stock_status,0)', array()); $collection->getSelect()->reset('order'); $collection->getSelect()->order('in_stock DESC');

tuyennn commented 2 years ago

@PiroozMB I'm not sure with your issue but could you update the issue follow the issue template which is your Preconditions such as: Magento version? elastic search version

PiroozMB commented 2 years ago

Hi. I installed magento2.4.3 and elasticsearch 8.

PiroozMB commented 2 years ago

Sorry, I came to understanding that the issue was with magent version 2.4.3 itself not with your extension. I solved it. You can close this. Thnx.