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.2.2(4w ago)31.2k1OSL-3.0PHPPHP ~8.3.0 || ~8.4.0

Since Apr 11Pushed 4w 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 today

READMEChangelog (7)Dependencies (6)Versions (14)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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMxNDU4MzYsIm5iZiI6MTc4MzE0NTUzNiwicGF0aCI6Ii8yOTc1ODQ1LzQzMzE2MTQzNi1lY2RmOTBkMi02YWZhLTQ1MjQtOTY0YS1iMjEyN2RiMWVhNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MDRUMDYxMjE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmUxNTJiZWUzMDYwYWEzZTJhMDIxODYxOGM1Yjk3MzJkOTgxODUyYzhiNzY5ZmE1ZWE1ODQwZGQwODhmNmFkZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.SAtg3rqfsBxHBUHsutxJJFN5VeCX60LhvSLZXwLZwDI)](https://private-user-images.githubusercontent.com/2975845/433161436-ecdf90d2-6afa-4524-964a-b2127db1ea5b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMxNDU4MzYsIm5iZiI6MTc4MzE0NTUzNiwicGF0aCI6Ii8yOTc1ODQ1LzQzMzE2MTQzNi1lY2RmOTBkMi02YWZhLTQ1MjQtOTY0YS1iMjEyN2RiMWVhNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MDRUMDYxMjE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmUxNTJiZWUzMDYwYWEzZTJhMDIxODYxOGM1Yjk3MzJkOTgxODUyYzhiNzY5ZmE1ZWE1ODQwZGQwODhmNmFkZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.SAtg3rqfsBxHBUHsutxJJFN5VeCX60LhvSLZXwLZwDI)- 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.12.0 or higher (introduces the layered-navigation filter `TypeProviderInterface`)

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)

### Filter registration: TypeProvider pattern (no FilterList override)

[](#filter-registration-typeprovider-pattern-no-filterlist-override)

This module has **no dependency** on `Smile_ElasticsuiteRating` and does **not** override `Smile\ElasticsuiteCatalog\Model\Layer\FilterList`.

The stock renderer is registered through the core ElasticSuite `filterTypeProviders` pool. `Smile\ElasticsuiteCatalog\Model\Layer\FilterList::getAttributeFilterClass()` iterates every injected `Smile\ElasticsuiteCatalog\Api\Layer\Filter\TypeProviderInterface` and lets it swap the filter class for its attribute. We provide one for `stock_status`:

```

            Amadeco\ElasticsuiteStock\Model\Layer\Filter\TypeProvider\Stock

```

Because the core `categoryFilterList` and `searchFilterList` virtual types extend that base type, they inherit the provider automatically — no preference, no virtual-type override, and no module load-order constraint against other filter modules.

Earlier versions extended `FilterList` and added a second preference over `Smile\ElasticsuiteRating\Model\Layer\FilterList` to resolve a preference conflict. Both the rating module ([PR #19](https://github.com/Smile-SA/magento2-module-elasticsuite-rating/pull/19)) and this module have since migrated to the `TypeProvider` pattern, so the conflict — and the dependency — no longer exist. Multiple filter modules now coexist cleanly because each only appends its own provider to the shared pool.

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

51

—

FairBetter than 95% of packages

Maintenance94

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~70 days

Recently: every ~104 days

Total

7

Last Release

29d ago

PHP version history (2 changes)v1.0.0PHP ~8.1.0||~8.2.0||~8.3.0

v1.2.1PHP ~8.3.0 || ~8.4.0

### 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 (48 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

8064.7M49](/packages/smile-elasticsuite)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

25966.8k1](/packages/smile-module-elasticsuite-cms-search)[smile/module-elasticsuite-rating

Smile ElasticSuite - Rating search module.

1498.6k3](/packages/smile-module-elasticsuite-rating)[smile/elasticsuite-for-retailer

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

18242.7k](/packages/smile-elasticsuite-for-retailer)[sehrling/elasticsuite-ghost-cleaner

Magento 2 module to delete ghost indices automatically for the Smile Elasticsuite module

17100.8k](/packages/sehrling-elasticsuite-ghost-cleaner)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.9k2](/packages/opengento-module-category-import-export)

PHPackages © 2026

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