Isotope Stock Management

Template adjustments

The extension comes by default with the stock template for list and reader modules. They are respectively named iso_list_stock and iso_reader_stock. They are based on the original Isotope templates with an enhancement to display the stock information:

<?php if ($this->isStockProduct): ?>
    <div class="stock<?php if ($this->isInStock()): ?> in-stock<?php endif; ?><?php if ($class = $this->getStockLevelCssClass()): ?> <?= $class ?><?php endif; ?>">
        <span class="stock-label"><?= $this->getStockLevelName() ?></span><?php if ($this->isInStock()): ?> <span class="stock-quantity">(<?= $this->getStockQuantity() ?>)</span><?php endif; ?>
<?php endif; ?>

The complete list of the template helpers is listed below:

$this->isStockProduct // returns true if the product is a stock one

$this->getStockQuantity() // gets the stock quantity as integer

$this->isInStock() // returns true if the product is in stock

$this->getStockLevelName() // gets the stock level name

$this->getStockLevelCssClass() // gets the stock level CSS class