← All modules

Magento 2 module

Product List: Out of Stock Last

Moves out-of-stock products to the end of the product lists of all categories, before the sort order chosen by the customer.

Also known as: out of stock products at the end, sort out of stock to bottom, show in-stock products first, move sold out products last

If your shop shows out-of-stock products, Magento mixes them in with everything else, so customers often land on products they cannot buy. This module puts the products in stock first and the out-of-stock products at the end of every category. They stay in the list, where customers can still find them and search engines can still see them, but they no longer push the products you can sell further down.

Features

  • Out-of-stock products come last in every category, on every page of the list. The first pages only hold out-of-stock products once all products in stock have been shown.
  • The sort order the customer picks (position, name, price) still applies, separately to the products in stock and to the out-of-stock products.
  • Magento already puts out-of-stock products last in the search results; the module does the same in all categories.
  • Works with any theme, including Hyvä, because the sorting happens on the server.

Configuration

Go to Stores > Configuration > Infrangible Solutions > Product List: Out of Stock Last > General > Enable (on by default, per website and store view). Out-of-stock products are only listed if “Display Out of Stock Products” is enabled under Catalog > Inventory > Stock Options.

Good to know

  • The module needs Magento’s inventory modules (MSI) with their search engine support, which are part of a standard installation. They add the stock to the search index.

Installation

Install the module with Composer in your Magento root directory:

composer require infrangible/m2-catalog-product-list-sort-stock

Then enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.