Magento 2 Product Shelf Life

97% of 100
Compatible with Magento 2 community and enterprise 2.3.3 - 2.4.x including cloud edition

Organize your products by batch based on shelf-life / expiry date with our Magento 2 Product Shelf Life extension. It optimizes stock by taking into account the shelf life of products and eliminates the risk of shipping a product whose shelf life has expired. It will give you the flexibility to organize and sell products from product batches making inventory management a breeze.

  • Easy backend grid to manage product batch
  • Automatic or Manual Batch Selection for Orders
  • Auto update product stock as per batch stock
  • Downloadable batch stock report
  • Bulk / Mass batch stock import/Export
  • Shelf life expiration notification email
  • Auto disable expired batch
  • API to create/delete/update/retrieve product batches
  • Supports multiple warehouses

Free Support

up to 60 days

Free Upgrades

up to 1 year

Fully open source


4.7 Saves a lot of time!
We have been this plugin for over 3 months now and it works great. We have had minor issue but support team has been great in answering our queries!
5 Quality plugin!
We use this plugin for one of clients and it works great within Magento as well for external system. We wanted to integrate this with ERP system and it works out of the box as it has APIs to create / update stock batches. Support team was extremely responsive to answer all our pre and post sale questions. Overall well pleased with this plugin!
Composer Package name:
Latest Version:

Product description

Magento 2 Product Shelf Life Extension

Compatible with Magento 2 community and enterprise 2.3.3 - 2.4.x including cloud edition

The scope of this module is to manage the product stock as per the batch product. It has both automatic and manual batch selection that you can choose from the configuration. If “automatic” batch selection is selected then by default the products whose shelf life is nearing their end will be prioritized and taken out of stock and sold first. Although you can choose a different batch selection attribute based on which product batches will be automatically selected giving you a ton of flexibility. Batch selection attributes include Batch ID, Batch Code, Batch Expiry, Batch quantity and date of creation. You can also choose to manually select batches during shipping of an order. It efficiently manages the shelf life of products and improves inventory management.

What is product shelf life?

Shelf life is the length of time that a commodity or perishable food may be stored without becoming unfit for use or consumption. Batches for products/materials that may no longer be used or sold after a certain time period are normally assigned expiration date or a shelf life expiration date.


Normally, there are different types of perishable products available in the store/business and they are maintained based on the expiry date. If the product is expired, then we cannot keep it for sales in the store because it is illegal to sell.

Determining the shelf life of processed foods is one of the main problems faced by food companies when launching a product to market, or when modifying some of its ingredients. That is why it is very important to have a module which creates batches of products and on order placement, the stock will be deducted from the batch of product which expires soon.

Manage Product Batches With Expiry Date

With the help of our extension you can easily manage the product stock and the shelf life of your products. It makes sales management comfortable and convenient by creating/associating product batches to the product. A product can have multiple batch levels with batch number, stock, and expiry date.


  • Improved inventory management
  • Keeps your stock fresh
  • Manage/Optimize products stock
  • Make sales management comfortable and convenient
  • Lower bounce rate

Below are the main features of this module-:

  • It allows you to add/create new batch from the product batches grid
  • It sends an email notification to admin for batch expiration
  • It allows you to automatically or manually select product batches for an order
  • You can select various batch selection attribute and its direction for automatic batch selection. For eg:- you can select “Batch Qty” as product selection attribute and “ASC” as product selection attribute directions. So now product batches with the least quantity is selected first during automatic selection.
  • Easy to update and edit batch details
  • It allows you to add a specific batch to product from the catalog->products page
  • You can easily "Enable" or "Disable" the batch from the batch grid
  • Admin can import/export the product batch levels and associate batch level to product
  • You can easily add/delete/remove/update/associate/un-associate Product batches from the back-end
  • Admin can easily manage the Product batches from the back-end
  • Batch import updates stock quantity and disable batches if they are expired
  • It supports multiple warehouses
  • It allows administrators to select source / warehouse while creating batches
  • It updates stock correctly at the source / warehouse level
  • It shows batch code, batch qty and batch expiry with order, invoice and credit memo in admin
  • It doesn't allow to delete batch if it is associated with any order that has been shipped
  • It doesn't allow to un-associate a batch if it is linked to an order that has been shipped
  • Refund puts the qty back to the same batch where order was placed regardless of batch being expired or disabled
  • It optimizes stock by taking into account the shelf life of products, and based on the expiry date the products will be prioritized and taken out of the stock first
  • It generates batch stock report which contains information about the batches
  • Handy and easily manageable batch grid on the product page
  • It shows associated product SKU on the batch details page
  • It organises products by batch based on shelf life
  • It prioritise the sale of products whose shelf life is nearing their end
  • It eliminates the risk of shipping a product whose shelf life has expired
  • Anticipate the loss of Inventory
  • It can be completely disabled if required from configurations
  • User friendly interface
  • Easy to install and manage


"Suppose you are running a store that sells medicines online. You have multiple warehouses with the same medicines. So how do you utilize the product shelf life extension to increase your efficiency?"

We know all medicines have an expiry date. You can create multiple batches of medicines and create multiple sources as per your requirements. Then add the source inventory to product batches. The quantity of the source inventory will automatically get updated with the quantity of the batches selected. Now, you can either choose to select product batches for specific orders manually or you can go with the automatic option. You can select batches automatically depending upon several options such as expiry date, quantity, id, code, and date of creation. There is also an option to choose the product batch selection direction “ASC/DSC”(Ascending/Descending). If you select expiry date then the product batches with the nearest expiry date will be selected first so that your inventory management becomes efficient and you will never have expired products in your inventory.


"Let’s say you are running a huge store online and you have new stocks coming in regularly. So clearing the previous stock first becomes the priority before you start selling the new stock. How can product shelf life extension help you manage the stocks automatically?"

After installing product shelf life extensions you can start creating product batches of previous stock first and then create batches of the new stock as soon as they come in. Now from the configuration, you can select the “product batch selection” to be based on the date of creation. Make sure the product batch selection direction is “ASC”(Ascending). So when you place an order, the batch with the oldest date of creation is selected first automatically. Now you don’t ever to worry about organizing and having old stocks of products. As whenever an order is processed the quantity will be deducted from the oldest stock.


"If I have created multiple product batches for a product and an order has been shipped with the quantity deducted from a specific product batch. Now, what happens to the product batch if a refund is processed? Also what happens if a batch is disabled or unassociated before the refund is processed?"

Suppose if the order has been shipped and the quantity has been deducted from a product batch then the customer refunds the order. In such cases, the quantity will be added back to the same product batch. Even if you disable the batch manually that product batch then too the refunded quantity will be added to the same product batch. Also, a batch cannot be deleted until it is linked with an order.

scenario 3

We offer 60 days of free support and 12 months of free upgrade for any standard Magento site when you buy this extension. You can also get our installation service for a small fee. If you want more benefits, you can purchase our 12 months of free premium support and free lifetime upgrade package. Please contact us if you need any assistance or customization for this extension. We will reply to you within 48 hours. We may also offer you a special deal or a free solution if we like your idea.

** Please refer to our FAQ or T&C section for running our extensions on multiple domains or sub-domains


Frequently Asked Questions


Q.Can I import the batches?
A. Yes, you can import the batches from the back-end,System->Import->Select File to Import - (CSV file).
Q.Can I disable the expired batch?
A. Yes, there is an option available in the configuration settings to disable the expired batch, Admin->Stores->Configuration->Scommerce->Product Shelf Life->Batch Settings->Disable batch once expired-"Yes''. It automatically disables a product batch that has crossed its expiry date. You can also manually disable a product batch by going into Catalog>Product Batches. Go to your batch and click edit from the actions column. In the batch, status select disable and then save. Please refer to the image below:- disable product batch
Q.How can I associate the batches to the product?
A. Yes, you can add/associate batches from the Catalog->Product->Product edit page.
Q.Can I un-associate the batch from the product?
A. Yes, you can un-associate from the Product Batches grid by going into Catalog>Product Batches and editing the specific batch that you want to un-associate. However, you won't be able to un-associate a product batch once it is linked to an order that has been shipped. un-associate product batch
Q.Can I manually select batches for orders?
A. Yes, you can choose to select batches automatically or manually from the configuration. Go to Stores>Configuration>Scommerce configuration> Product Shelf Life Expiration. Here set Batch Selection to “manual”. Now you can manually select a product batch while shipping an order.
Q. How do I remove or delete a product batch?
A. To delete a product go to Catalog>Product Batches. Select your batch and click Edit from the Action column. You will see a delete button on the top of your screen. Clicking it will delete that product batch. However, you won’t be able to delete a product batch that has been linked to an already shipped order.
Q.Is there an API to create/delete/update/retrieve Product Batches?
A. Yes, we have a dedicated API to create/delete/update/retrieve product batches. Please refer to the user guide for more details on the same.
Q.Does this extension work with MSI(Multi Source Inventory) enabled and MSI Disabled?
A. Yes, this extensions works with both MSI Enabled and MSI Disabled environments.
Q. Do I get email notifications for the product batches about to expire?
A. Yes, you can enable batch expiry notifications from the configuration to receive regular email notifications for the batches that are about to expire. To enable this functionality go to admin>stores>configuration>scommerce configuration>Product shelf life extension>batch settings. Set “Batch expiry email notification” to “Yes”. You can also add comma separated recipients and choose an email template as well.
Q. Can I associate/add a specific batch to the product?
A. Yes, you can add a specific batch from the Catalog->Product->Product edit page->Product Batches->Add Specific Batch .
Q. What happens to the products during Refund?
A. If an order is linked to a certain product batch then upon refund of the order, the order quantity is added back to the same batch. It also applies to the expired/disabled/un-associated batches.
Q. Can I show the batch details in the Backend?
A. Yes, you can. It shows the batch details at the item level (Sales->Order->Order view), on invoice and credit memo.
Q. Is there a report available for all the batches against orders?
A. You can access the detailed batch stock report by going into your admin panel then navigating to Reports>Sales>Batches. product batch report
Q. Can you update existing batch information for example qty or source?
A.Yes you can but this might have a direct impact on your existing orders if same batch is getting used with existing orders especially when you mark them as disabled or reduce qty or change the source.

Q. How can I get license key for my development website?
A. Please login to your account and Go to My account section > From the left menu select Generate Dev License key > Enter the Dev site url and select the extension from the dropdown and click on generate to get the license key
Q. Can I test the extension before buying?
A. Unfortunately we can't provide you extension for testing purposes but we have demo available for most of our extensions and happy to provide full refund if the extension doesn't work
Q. Can I request for customisation on your extensions?
A. Yes we do provide all sort of customisation for our clients at the reasonable rates. And if we believe the customisation will help our product then we also provide great discount on the customisation
Q. I have two live domains, do I need a separate license key for each live domain?
A. Yes you need to buy a separate license key for each live domain ( or sub-domain ( or subfolder ( If you are buying licenses for more than four live sites in one transaction then we can offer you 30% discount on total amount
Q. How can I upgrade my extension to the latest version?
A. If your extension is within the free upgrade period (12 months from purchased date) then simply email us with your order number and our team will send you the latest version of the extension but if it is outside free upgrade period then you need to buy an upgrade using the following link

Once you received the latest version of our extension then we would highly recommend to delete all the files and folder of our extension from your website first before uploading the latest version because we might have removed existing files and keeping existing files could cause problems on your website.
Q. Does my license get expired after certain period?
A. No, your license is not going to get expired but we would highly recommend upgrading to get all the latest fixes (including security fixes if any), improvements and new features. In the upgrade, we also ensure it is compatible with the latest version of Magento and when you upgrade you will have a smooth transition.
Q.Where can I download the extension files?
A. Please login into your account on our website and go to the download link under my account section to download the extension package.
Q.Can you provide a key that works for our development (NOT PRODUCTION) environment which will work on a dynamic URL, for example, and
A. Unfortunately it is not possible to generate license keys based on the dynamic URLs. License keys need to be generated per domain or subdomain whether it is production or non-production.
Q. How can I manually uninstall your module?
A. Please follow the below steps -:

Step 1: Navigate to our store and login to your account. Then go to the My Account Section, on the left menu click on Composer Instructions.
My account section
Step 2: Next, run the config commands shown on the top of the page then click on the extension that you want to install. A composer require command will be revealed in the dropdown menu. Run the command then clear caches to complete the installation. Composer instructions
Q. Do you support SPA (Single Page Application) / PWA (Progressive Web Application) / AMP ?
A. Unfortunately, we don’t support SPA or PWA or AMP but we may be supporting them in future depending upon the demand.

Change Log

Version 2.1.7
2024-04-03 15:06:33
The following changes have been made
- Transitioned from installation scripts to db_schema.xml for Magento compliance.
- Refactored observer properties to enhance code quality and readability
Version 2.1.6
2023-11-15 15:06:24
Resolved the error that happened when a new batch was saved with no associated product SKU
Version 2.1.5
2022-09-09 11:34:44
Added PHP 8 Support
Version 2.1.4
2021-12-15 14:19:21
Fixed issue related to sending expiration email to administrator via cron schedule
Version 2.1.3
2021-04-09 11:24:31
- Added support to batch with simple products which are associated with configurable product. Also given new feature to add product when creating batches to speed up the batch creation process.
Version 2.1.2
2021-03-02 13:26:08
Added Update API support which allows to update batches from external systems
Version 2.1.1
2021-02-15 12:33:08
Made it compatible with Magento 2.4.1 version
Version 2.1.0
2021-02-05 15:24:57
- Added feature to allow manual batch selection when creating shipment
- Made it compatible with MSI disabled
- Changed the menu location under catalog for better admin management
- Made it compatible with older Magento 2.3.2 version
Version 2.0.5
2020-12-03 16:32:36
Fixed issue related to partial refund. Also added support to change status of product to out of stock when all the batches gets expired.
Version 2.0.3
2020-09-29 14:51:50
Added support to add / update / delete / view batches using REST APIs. Also added PHP 7.4 support to the module
Version 2.0.2
2020-03-19 06:49:27
Fixed source related issues in case of multi-source Inventory
Version 2.0.0
2019-09-25 18:11:27
Initial Release
Show More
Show Less

Reviews 2

Write Your Own Review
Write a Review
You may also like