LogoLogo
  • Magento 2 Extensions
    • SEO Extensions
      • Magento 2 Canonical Urls for Category, Product, CMS, and Other pages
      • Magento 2 Advanced SEO Suite
      • Magento 2 Cross Linking SEO
      • Magento 2 Google Page Speed Optimizer
      • Magento 2 Google Site Map Exclusion
      • Magento 2 Alternate Hreflang Tags
      • Magento 2 Google Rich Snippets
      • Magento 2 SEO Unique Catalog URLs
    • Site Speed Extensions
      • Magento 2 Full Page Cache Warmer
      • Magento 2 Google Page Speed Optimizer
      • Magento 2 Image Optimizer
      • Magento 2 AJAX Infinite Scroll
      • Magento 2 Lazy Load Image
    • Marketing Extensions
      • Magento 2 How Did You Hear About Us
      • Magento 2 Free Shipping Bar
      • Magento 2 Product Scheduler
      • Magento 2 Apply Discount coupon Code Via Link
      • Magento 2 Dynamic Sale Catagory
      • Magento 2 Facebook Conversion and Audience Pixel Tracking
      • Magento 2 Google Dynamic Remarketing Tag
      • Magento 2 Perfect Audience Tracking
      • Magento 2 Product Feed
      • Magento 2 Cash Back Discount
      • Magento 2 Competition or Prize Draw with Social Booster
      • Magento2 Custom Options Discount
      • Magento 2 Product Label
    • Analytics & Tracking Extensions
      • Magento 2 Google Global Site Tag (gtag.js) with GA4(Google Analytics 4) Enabled
      • Magento 2 Google Enhanced Ecommerce Tracking
      • Magento 2 Google Tag Manager (GTM) GA4 Ecommerce Tracking
      • Magento 2 Google Tag Manager Tracking
      • Magento 2 missing orders or transactions in Google Analytics (GA)
      • Magento 2 Consent mode's setup guide
    • Payment and Shipping Extensions
      • Magento 2 Delivery Instructions and Delivery Date
      • Magento 2 Product Handling or Additional Fee
      • Magento 2 Surcharge or Additional Fee
      • Magento 2 Shipping Carrier Tracker
    • User Experience Extensions
      • Magento 2 How Did You Hear About Us
      • Magento 2 FAQ
      • Magento 2 Subcategory Grid/List Extension
      • Magento 2 Ajax Login and Add to Wishlist
      • Magento 2 Custom Stock Status Extension
      • Magento 2 Product Shelf Life
      • Magento 2 VAT Exemption
      • Magento 2 Cancel Order by Customer on the Frontend
      • Magento 2 Lazy Load Image
      • Magento 2 AJAX Infinite Scroll
      • Magento 2 Previously Ordered Products
      • Magento 2 Social Login
      • Magento 2 Substitute Products
      • Magento 2 Product 360 view
      • Magento 2 Product Reviews
    • Admin Extensions
      • Magento 2 Update Order Email Address
      • Magento 2 Admin Action Log
      • Magento 2 Ajax Login and Add to Wishlist
      • Magento 2 Custom Stock Status Extension
      • Magento 2 Product Shelf Life
      • Magento 2 Repeat Order
      • Magento 2 Associated or Linked Product Stock Update
      • Magento 2 VAT Exemption
      • Magento 2 Order Delete or Archive
      • Magento 2 Order Tagger
      • Magento 2 Subcategory Grid/List Extension
      • Magento 2 Advanced Reporting Extension
      • Magento 2 Export Custom Product Attribute
      • Magento 2 Advanced Admin Login Security
      • Magento 2 Admin Security Checklist
      • Magento 2 Security Suite
      • Magento 2 AI Content Generator
      • Magento 2 Content Security Policy (CSP) Whitelist Manager
      • Magento 2 OTP Login
      • Magento 2 Admin Account Switcher
    • Data & Privacy Extensions
      • Magento 2 Not On The High Street Integration
      • Magento 2 GDPR Compliance: Anonymisation of order data
      • Magento 2 Antispam Extension
    • Integration Extensions
      • Magento 2 Diamond Search
      • Magento 2 Not On The High Street Integration
      • Magento 2 Creditsafe Integration
    • Installation Via Composer
  • Magento 1 Extension
    • SEO Extensions
      • Magento SEO Unique Catalog URLs
      • Jquery Asynchronous Image Loader (JAIL)
      • Magento Image Optimizer
      • Canonical Urls for Category, Product and CMS pages
      • Google Site Map Exclusion with Image sitemap
      • Google Friendly SEO Layered Navigation
      • Magento Rich Snippets & Cards (schema.org)
      • Meta Information for Any Page
    • Marketing Extensions
      • Where Did You Hear About Us?
      • Google Tag Manager Tracking
      • Google AdWords Conversion Tracking
      • Order Follow Up or Review Booster
      • Competition or Prize Draw Module with Social Booster
      • Apply Discount Coupon Code via Link
      • Abandoned Basket Email Alert
      • Cash Back Discount
      • Dynamic Sale Category
    • Analytics & Tracking Extensions
      • Google AdWords Conversion Tracking
      • Google Adwords Dynamic Remarketing Tag
      • Facebook Conversion and Audience Pixel Tracking
      • Perfect Audience Tracking
      • Google Enhanced Ecommerce Tracking
      • Magento 1 / OpenMage GA4 Google Tag Manager (GTM)
      • Magento 1 Google Global Site Tag (gtag.js)
      • Magento 1 Consent mode's setup guide
      • Magento 1 Google Analytics Synchronization Extension
    • Payment and Shipping Extensions
      • Magento Delivery Instructions or Order Comments
      • Surcharge or Additional Fee
      • Magento Surcharge or Additional Fee on Payment Method or Countries
    • User Experience Extensions
      • Product Image Resize
      • Magento Delivery Instructions or Order Comments
      • Single Product Category Redirect
      • Testimonials
    • Admin Extensions
      • Admin Order Email
      • Magento Update Order Email Address
      • Product Review Administrator Notification Email
      • Automated Product Publish Date
      • Order Follow Up or Review Booster
      • Custom Variables Anywhere
      • Testimonials
    • Data & Privacy Extensions
      • EU Cookie Notification
      • Magento 1 GDPR Compliance: Anonymisation of order data
    • Site Speed Extensions
      • Product Image Resize
      • Jquery Asynchronous Image Loader (JAIL)
      • Magento Image Optimizer
Powered by GitBook
On this page
  • Installation and User Guide for Magento 2 Product Shelf life Extension
  • Installation
  • Configuration Settings for Product Shelf Life Expiration
  • Batch Settings
  • API - Application Programming Interface

Was this helpful?

Export as PDF
  1. Magento 2 Extensions
  2. User Experience Extensions

Magento 2 Product Shelf Life

PreviousMagento 2 Custom Stock Status ExtensionNextMagento 2 VAT Exemption

Last updated 8 months ago

Was this helpful?

Installation and User Guide for Magento 2 Product Shelf life Extension

Table of Contents

    • Installation via app/code

    • Installation via Composer

    • General Settings

    • Batch Settings

    • Product Batches Grid

    • Add Sources at Product Level

    • Add New Product Batch

    • Un-Associate / Delete Product Batch

    • Product Batches at Product Level

    • Add Specific Batch to Product

    • Select Batches During Shipment

    • Batch Details on the Order View Page

    • Deleting or Un- Associating a Product Batch

    • Deleting

    • Un-Associating

    • Batch Report

    • Import / Export Product Batches

    • Batch Expiration Email Notification

    • Authentication Token

    • Creating a Batch using API

    • Retrieve all Batches using API

    • Retrieve Date of Batch using ID 1 Using API

    • Delete Batch with ID 1 Using API

Installation

  • Installation via app/code: Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
  • Installation via Composer: Please follow the guide provided in the below link to complete the installation via composer.

Configuration Settings for Product Shelf Life Expiration

Go to Admin > Stores > Configuration > Scommerce Configuration > Product Shelf Life Expiration

General Settings

  • Enabled - Select “Yes” or “No” to enable or disable the module.

Batch Settings

  • Batch expiry email notification period (number of days) - Please define batch expiry email notification period. This setting will check the batch expiry date and will send an email notification to the admin for the same.

  • Batch expiry email notification (Yes/No) - Please select “Yes” or “No” to “Enable” or “Disable” the email notification regarding batch expiration.

  • Disable batch once expired - Please select “Yes” or “No” to disable the batch. It disables the batch automatically once their expiry date is passed and runs as part of cron job at midnight.

  • Email Addresses - Please provide email addresses (comma separated) to send the batch expiration email notification.

  • Email Sender – Please select sender/ from email addresses for Batch expiry updated.

  • Select Email Template -Please select the email template for batch expiry email notification.

  • Cron Scheduler for expiry batch notification - This setting will be used to send the email through the cron.

  • Batch Selection Attribute – This setting will determine how batches are selected automatically.

  • Batch Selection Attribute Direction – As per the batch selection attribute you can choose the direction for example Ascending(ASC) or Descending(DSC).

  • Batch Selection – You can choose to select batches automatically based on batch selection attribute or you can set it to Manual. When Manual you will be able to select batches during shipment.

Product Batches Grid

You can create and manage product batches from, Admin> Product Batches. This grid will have all the details about batches like ID, Batch Code, Product SKU, Batch Status, Batch Qty, Batch Expiry, Action/Edit and Source Inventory.

  • Add Sources at Product Level -You can add product source from Admin > Catalog > Select Products > Click "Assign Sources"> Select "Source"> Click "Done" .

  • Add New Product Batch -To create new product batch, go to Admin > Product Batches>click 'Add New Batch'. It will take you to the new product batch page and by providing all the required details; you can create the new batch.

  • Un-Associate / Delete Product Batch -Toun-associate and delete product batch, go toAdmin > Product Batches> Select Batch > Edit >Click "Un-Associate with Product'' and for Delete click on "Delete" button.

Product Batches at Product Level

When user enables the module then Product Batches section appears at, Admin>Catalog>Product>Select Product>Edit>Product Batches. From this section, users can add new batch or can associate specific existing batch to a product.

Add Specific Batch to Product

You can also add specific batches to a product from, Admin > Catalog > Product > Select Product >Edit >Product Batches >Click"Add Specific Batch". It redirects to Batch Grid and by selecting batch ID you can associate active batches to a product.

  • Select Batches During Shipment -To select the batch during shipment make sure Batch Selection is set to manual in the configuration then navigate to Admin> Sales > Order > Select Order > View>Generate Invoice>Click on Ship. When you scroll down on the page you will see the option to select the batches manually. The product quantity will be deducted from the selected batch. Please refer to the image below:-

  • Batch Details on the Order View Page -To view theproduct batch related details, go to Admin > Sales > Order > Select Order > View.

Deleting or Un- Associating a Product Batch

  • Deleting: -To delete a product batch, go to Catalog>Product Batches then select the product batch that you want to delete. From Action coloumn click Edit. Here you will see the option to delete the Product batch.

Note:- If an order has been shipped then you won’t be able to delete that product batch. You will see an error.

  • Un-Associating:- To Un-Associate a product batch, go to Catalog>Product Batches then select the product batch that you want to delete. From Action column click Edit. Here you will see the option to Un-Associate the Product batch.

Note:- If an order has been shipped then you won’t be able to delete that product batch. You will see an error.

  • Batch Report:- To view the detailed batch report go to your admin panel then Reports>Sales>Batches. Here you can see all the orders associated with a product batch with the following information:-

  • Order Number

  • Purchase Date

  • Customer

  • Customer Group

  • Product Name

  • Batch code

  • Batch Quantity

  • Expiry Date

Import / Export Product Batches

To import and export product batches, go to Admin > System >Import / Export.

  • Import - It updates the stock quantity and disables the batches if they are expired.

  • Export-It exports the batches in the selected file format, e.g. CSV.

Import Settings

CSV File Format for Import - CSV file will have batch_code, batch_qty, batch_status, batch_expiry, product_sku and source_inventory.

Export Settings

  • Batch Expiration Email Notification - When you select "Yes" for "Batch expiry email notification"from Admin > Stores > Configuration > Scommerce Configuration > Product Shelf Life Expiration > Batch Settings, then it sends an email notification for batch expiration.

API - Application Programming Interface

Authentication Token

auth_token can be received using the following: -

You would need credentials to your store with admin rights Parameters:-.Admin credentials

  • Username

  • Password

{

"username": "admin", "password": "admin"

}

Creating a Batch using API

Parameters:-

  • Authorization token received from the above step

  • Batch code

  • Batch quantity

  • Batch status

  • Batch expiry

  • Product SKU

Authorization: Bearer {{auth_token}}

{

"batch_code": "batchcode_001", "batch_qty": "10",

"batch_status": "1",

"batch_expiry": "2020-12-06", "product_sku": "MH0001"

}

Retrieve all Batches using API

Parameters:-

Authorization token

Authorization: Bearer {{auth_token}}

Retrieve Date of Batch using ID 1 Using API: -

Parameters: -

  • Authorization token

  • Batch ID in URL

Authorization: Bearer {{auth_token}}

Delete Batch with ID 1 Using API: -

Parameters: -

  • Authorization token

  • Batch ID

Authorization: Bearer {{auth_token}}

{

"batchId": 1

}

License Key –Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at .

POST URL:- Content-Type: application/json

POSTURL:- Content-Type: application/json

GET URL:- Content-Type: application/json

GET URL:- Content-Type: application/json

PUT URL: - Content-Type: application/json

If you have a question related to this extension please check out our first. If you can't find the answer you are looking for then please contact .

Installation Via Composer
support@scommerce-mage.com
http://baseurl/index.php/rest/V1/integration/admin/token
http://baseurl/index.php/rest/V1/productbatches/createbatch
http://baseurl/index.php/rest/V1/productbatches/getcollection
http://baseurl/index.php/rest/V1/productbatches/getbatch?batchId=1
http://baseurl/index.php/rest/V1/productbatches/deletebatch
FAQ Section
support@scommerce-mage.com
Installation
Configuration Settings for Product Shelf Life Expiration
API - Application Programming Interface
A screenshot of a video game Description automatically generated
C:\Users\USER\Desktop\Screenshot 2021-02-10 220805_2.png
Import Import Export Data Transfer System Magento Admin.png
Export Import Export Data Transfer System Magento Admin.png
Shelf Life Expiration Notification Gmail_011.png