Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conlabz StockIndicator: Magento 2 Extension für Lagerbestandsanzeige bei konfigurierbaren Produkten

🇩🇪 Deutsch · 🇬🇧 English

Diese Magento 2 Extension zeigt bei konfigurierbaren Produkten (z. B. Größen- oder Farb-Swatches) direkt an, ob die jeweilige Variante auf Lager ist, basierend auf einem konfigurierbaren Schwellenwert.

MIT License Magento 2

Deutsch

Funktion

Conlabz_StockIndicator erweitert die JSON-Konfiguration des Configurable-Product-Blocks (Magento\ConfigurableProduct\Block\Product\View\Type\Configurable) über ein Plugin um Lagerbestandsinformationen:

  • Für jede erlaubte Produktvariante wird die aktuelle Lagermenge (StockStateInterface::getStockQty) ermittelt.
  • Ein JavaScript-Mixin für den Swatch-Renderer (view/frontend/web/js/swatch-renderer-mixin.js) nutzt diese Daten, um Varianten unterhalb des Schwellenwerts entsprechend zu markieren.
  • Die Texte "In stock" / "Out of stock" sowie der Schwellenwert werden über ein ViewModel (StockInfo) bereitgestellt.

Konfiguration

Im Magento Backend unter Stores > Configuration > Catalog > Inventory > Stock Indicator:

  • Out of stock threshold (cataloginventory/stock_indicator/out_of_stock_threshold) – Schwellenwert, ab dem eine Variante als "Out of stock" markiert wird. Standardwert: 0.

Abhängigkeiten

Modulreihenfolge (etc/module.xml): Magento_ConfigurableProduct, Magento_CatalogInventory.

Installation

composer require conlabz/magento2-module-stock-indicator
bin/magento module:enable Conlabz_StockIndicator
bin/magento setup:upgrade

Support

Bei Fragen zu dieser Extension: conlabz.de


English

What it does

Conlabz_StockIndicator extends the JSON configuration of the configurable product block (Magento\ConfigurableProduct\Block\Product\View\Type\Configurable) via a plugin with stock information:

  • For every allowed product variant, the current stock quantity is determined (StockStateInterface::getStockQty).
  • A JavaScript mixin for the swatch renderer (view/frontend/web/js/swatch-renderer-mixin.js) uses this data to mark variants below the threshold accordingly.
  • The "In stock" / "Out of stock" texts and the threshold are provided via a view model (StockInfo).

Configuration

In the Magento admin under Stores > Configuration > Catalog > Inventory > Stock Indicator:

  • Out of stock threshold (cataloginventory/stock_indicator/out_of_stock_threshold) – quantity threshold below which a variant is marked as "Out of stock". Default value: 0.

Dependencies

Module sequence (etc/module.xml): Magento_ConfigurableProduct, Magento_CatalogInventory.

Installation

composer require conlabz/magento2-module-stock-indicator
bin/magento module:enable Conlabz_StockIndicator
bin/magento setup:upgrade

Support

For questions about this extension: conlabz.de


License

This extension is licensed under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages