PHPackages                             amadeco/module-elasticsuite-stock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. amadeco/module-elasticsuite-stock

ActiveMagento2-module[Search &amp; Filtering](/categories/search)

amadeco/module-elasticsuite-stock
=================================

Enhance your Magento 2 store with an advanced stock filter in ElasticSuite's layered navigation. This module provides customers with the ability to easily filter products by stock availability, improving the shopping experience and helping them find in-stock items faster.

v1.1.2(1y ago)34861OSL-3.0PHPPHP ~8.1.0||~8.2.0||~8.3.0

Since Apr 11Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Amadeco/magento2-elasticsuite-stock)[ Packagist](https://packagist.org/packages/amadeco/module-elasticsuite-stock)[ RSS](/packages/amadeco-module-elasticsuite-stock/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

Amadeco ElasticSuite Stock Filter Module for Magento 2
======================================================

[](#amadeco-elasticsuite-stock-filter-module-for-magento-2)

[![Latest Stable Version](https://camo.githubusercontent.com/8980804863b5eb509f4ee52282ad7f651ad054cf05535346c2a0c55e63ff10a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f697061726d656e746965722f6d6167656e746f322d656c617374696373756974652d73746f636b)](https://github.com/iparmentier/magento2-elasticsuite-stock/releases)[![Magento 2](https://camo.githubusercontent.com/7ca3909c73f8748e38748627518617c1217a86ccbc1387f75dc61eaf8f405680/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e782d627269676874677265656e2e737667)](https://magento.com)[![PHP](https://camo.githubusercontent.com/83d697baa78e4225d630587096ed1b0d8a0ece94e9b2ebab599fc9bb986477ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d626c75652e737667)](https://www.php.net)[![License](https://camo.githubusercontent.com/26ed649e292f24c7672ab65ce0ee105ee368ad86243a3be30cb0f2cbf71fbe55/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f697061726d656e746965722f6d6167656e746f322d656c617374696373756974652d73746f636b)](https://github.com/iparmentier/magento2-elasticsuite-stock/blob/main/LICENSE.txt)

[SPONSOR: Amadeco](https://www.amadeco.fr)

This module by Amadeco extends Smile ElasticSuite () to add an advanced stock filter in the layered navigation.

PR to reimplement "quantity\_and\_stock\_status" product attribute (currently open) : [magento/magento2#40425 (comment)](https://github.com/magento/magento2/pull/40425#issue-3797047961)

Features
--------

[](#features)

[![Capture d'écran 2025-04-13 à 21 23 40](https://private-user-images.githubusercontent.com/2975845/433161436-ecdf90d2-6afa-4524-964a-b2127db1ea5b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4OTcxNTIsIm5iZiI6MTc3NDg5Njg1MiwicGF0aCI6Ii8yOTc1ODQ1LzQzMzE2MTQzNi1lY2RmOTBkMi02YWZhLTQ1MjQtOTY0YS1iMjEyN2RiMWVhNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMTg1NDEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDdlZjFhNjUyYTE2ZmY3ODVhNGZmOGM2OTJlZGI2Y2RmMThhYzM0ZjUwNzk0NTE0YzdmY2VlODgwMTQzNmJjOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.aGmiBa6gopNb1-2Uf51wp56syziUna1kzRv6Fl376Cw)](https://private-user-images.githubusercontent.com/2975845/433161436-ecdf90d2-6afa-4524-964a-b2127db1ea5b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4OTcxNTIsIm5iZiI6MTc3NDg5Njg1MiwicGF0aCI6Ii8yOTc1ODQ1LzQzMzE2MTQzNi1lY2RmOTBkMi02YWZhLTQ1MjQtOTY0YS1iMjEyN2RiMWVhNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMTg1NDEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDdlZjFhNjUyYTE2ZmY3ODVhNGZmOGM2OTJlZGI2Y2RmMThhYzM0ZjUwNzk0NTE0YzdmY2VlODgwMTQzNmJjOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.aGmiBa6gopNb1-2Uf51wp56syziUna1kzRv6Fl376Cw)- Adds a dedicated stock filter in the layered navigation
- Intelligent handling of stock status based on Magento's backorders configuration
- Improves user experience by showing accurate product availability
- Provides clear "In Stock" and "Out of Stock" filter options
- Fully compatible with Magento's MSI (Multi-Source Inventory)

Installation
------------

[](#installation)

```
composer require amadeco/module-elasticsuite-stock
bin/magento module:enable Amadeco_ElasticsuiteStock
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
bin/magento indexer:reindex catalogsearch_fulltext
```

Requirements
------------

[](#requirements)

- PHP 8.3+
- Magento 2.4.x
- Smile ElasticSuite 2.8 or higher
- Smile ElasticSuite Rating 2.3 or higher

Configuration
-------------

[](#configuration)

Go to Stores &gt; Configuration &gt; ElasticSuite &gt; Stock Filter

Configure the following options:

- **Display Out Of Stock Filter**: When enabled, shows the "Out of Stock" option in the layered navigation. When disabled, only the "In Stock" option is shown.

Usage
-----

[](#usage)

After installation and configuration, the stock filter will automatically appear in the layered navigation on category pages and search results pages (remember to reindex after installation).

How It Works
------------

[](#how-it-works)

### Smart Stock Status Determination

[](#smart-stock-status-determination)

This module creates an indexed attribute `stock_status` that handles stock differently based on your Magento configuration:

#### When Backorders are Disabled

[](#when-backorders-are-disabled)

- Uses Magento's native stock status logic
- Products are either in stock or out of stock, as determined by Magento's inventory system

#### When Backorders are Enabled

[](#when-backorders-are-enabled)

- **Enhanced behavior**: Determines availability based on actual quantity
- Products with quantity &gt; 0 are marked as "In Stock"
- Products with quantity ≤ 0 are marked as "Out of Stock" (even if Magento would allow them to be ordered)
- This gives customers a clearer view of which products have physical inventory

### Filter Options in Layered Navigation

[](#filter-options-in-layered-navigation)

The filter provides these options:

1. **In Stock**:

    - Shows products with positive inventory when backorders are enabled
    - Follows standard Magento stock status rules when backorders are disabled
2. **Out of Stock** (can be hidden via configuration):

    - Shows products with zero or negative inventory when backorders are enabled
    - Shows products marked as out of stock when backorders are disabled

This approach helps customers find products based on actual availability while respecting your inventory settings.

Technical Details
-----------------

[](#technical-details)

### Stock Data Implementation

[](#stock-data-implementation)

This module leverages the existing `stock.is_in_stock` and `stock.qty` fields from `quantity_and_stock_status` attribute and creates a derived `stock_status` field that combines this information intelligently.

Instead of relying on Magento's `quantity_and_stock_status` attribute (which has limitations for filtering ; see reported issue: [magento/magento2#33453](https://github.com/magento/magento2/issues/33453)), our module:

- Creates a dedicated filterable attribute for stock status
- Applies specific logic when backorders are enabled to show actual inventory status
- Integrates seamlessly with ElasticSuite's facet filtering system

Compatibility with Other ElasticSuite Modules
---------------------------------------------

[](#compatibility-with-other-elasticsuite-modules)

### Dependency on Smile\_ElasticsuiteRating: Technical Explanation

[](#dependency-on-smile_elasticsuiterating-technical-explanation)

Smile\_ElasticsuiteRating is a required dependency due to how Magento's preference system works:

Both modules (Rating and our Stock module) attempt to override Smile\\ElasticsuiteCatalog\\Model\\Layer\\FilterList using preferences. In Magento's preference system, when multiple modules declare a preference for the same class, only the last one loaded (based on module loading order) takes effect. If Smile\_ElasticsuiteRating is installed but our module's preference isn't properly applied, our stock filter won't appear in the layered navigation.

To solve this conflict, we must:

```

```

This approach requires Smile\_ElasticsuiteRating to be present since we're explicitly overriding its class. Without it, Magento would throw a fatal error when trying to resolve this preference.

**Note:** We recognize that the current dependency on Smile\_ElasticsuiteRating is not ideal. In a future release, we plan to implement a more flexible architecture.

License
-------

[](#license)

This module is licensed under the Open Software License ("OSL") v3.0. See the [LICENSE.txt](LICENSE.txt) file for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance65

Regular maintenance activity

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b211427be009c505885db00496fe829753399414856083648cec5c7af5003fcd?d=identicon)[IlanAmadeco](/maintainers/IlanAmadeco)

---

Top Contributors

[![Amadeco](https://avatars.githubusercontent.com/u/2975845?v=4)](https://github.com/Amadeco "Amadeco (39 commits)")

---

Tags

elasticsearchelasticsuiteinventorymagentomagento2magento2-extensionmagento2-modulemerchandisingstocksearchelasticsearchmagentomerchandisinginventorymagento2stock

### Embed Badge

![Health badge](/badges/amadeco-module-elasticsuite-stock/health.svg)

```
[![Health](https://phpackages.com/badges/amadeco-module-elasticsuite-stock/health.svg)](https://phpackages.com/packages/amadeco-module-elasticsuite-stock)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

25916.7k1](/packages/smile-module-elasticsuite-cms-search)[smile/elasticsuite-for-retailer

Smile ElasticSuite for Retailers - Magento2 toolkit for Retailers : Store Locator, Availability and Prices per store, etc...

18235.4k](/packages/smile-elasticsuite-for-retailer)[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M943](/packages/elasticsearch-elasticsearch)[smile/module-elasticsuite-rating

Smile ElasticSuite - Rating search module.

1492.1k2](/packages/smile-module-elasticsuite-rating)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
