How to move out-of-stock products to the end of the catalog for all categories?

How to move out-of-stock products to the end of the catalog for all categories?

When it is necessary to position out-of-stock products to the end of the list, the Improved Sorting extension could be used as it allows changing product sorting globally.

To change the position of the out-of-stock items, you need to navigate to  Amasty > Improved Sorting > Configuration > General and enable the Show Out of Stock Products Last setting. Here’s a screenshot for visual reference:



In case it is necessary to enable the feature for a certain category only, the Visual Merchandiser module could be used. For this to be done, navigate to the category in question and apply the Sort Order: Move out of stock to bottom option.

As a result, the out-of-stock items are displayed last in the category: