Closed ArthurMenegoli closed 2 months ago
Thank you for the report, I believe while the number of products rising in some ways doesn't affect anything to the algorithm. Just make sure your indexing is working properly on your side.
For anyone wondering.. we found the indexing issue.
Elasticsearch 7 was correctly configured and the indexer was correctly reindexing. But for some reason, the Magento installation on our stores did not correctly create the inventory_stock_1 view on database. It might be because of our installation script or maybe incompatible libs. We don't know yet.
But that caused the module to determinate "is_salable" of all products as 0, so the sorting attribute of "out_of_stock" was indeed sorted by desc, but since all products had the same value, the sort ended up being irrelevant.
We fixed the view table inventory_stock_1 via this script:
CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW
inventory_stock_1AS select distinct
legacy_stock_status.
product_idAS
product_id,
legacy_stock_status.
website_idAS
website_id,
legacy_stock_status.
stock_idAS
stock_id,
legacy_stock_status.
qtyAS
quantity,
legacy_stock_status.
stock_statusAS
is_salable,
product.
skuAS
sku from (
cataloginventory_stock_status`legacy_stock_status
join catalog_product_entity
product
on
((legacy_stock_status
.product_id
= product
.entity_id
)));`
After that, reindexing was able to correctly assume products "is_salable", fixing the sort.
Thank you tuyenn for pointing out the indexing issue, helped on our debugging.
Duplicate with https://github.com/tuyennn/magento2-outofstockatlast/issues/55 and related to https://github.com/magento/magento2/issues/19542
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Hi. We have a great interest in the functionality of this module, and it works perfectly fine for our clients on category pages where the product collection size is fewer than 10 products. But as soon as new products are added, the sorting no longer works. I have tried disabling other third-party modules, changing the theme to Luma, and even updating the Magento version. But nothing seems to help.
Is this a known bug or an intended feature? Or am I just missing something? Why would the module work that way for us? Can you shed some light on how to solve this or what might be causing this behavior?
Thank you for your time. Arthur Menegoli Cammino Digital