Skip to content

Display a custom message about the salable quantity on the product detail page. E.g. Only x items left! Disable the Add to cart button for products without salable quantity.

License

Notifications You must be signed in to change notification settings

PeterBrain/magento2-salable-qty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 Module - SalableQty

Package name: peterbrain/magento2-salable-qty

Main Functionalities

  • Display a custom message about the salable quantity on the product detail page.
    • Customizable message: Only x item(s) left!
    • Customizable threshold
  • Display custom message for products without salable quantity. This is the case if a product quantity equals 1 and is ordered, but is not yet shipped. The default behavior of Magento is to display an error message that the requested quantity is no longer available after a click on the Add to cart button. Not ideal, because this can cause confusion as the product will continue to be displayed as "in stock" until it is shipped.
    • Option to disable the Add to cart button
    • Option to show a lock symbol on the Add to Cart button
    • Custmizable message: This product has been sold recently and is no longer available.

Display custom message for products with salable quantity at or below threshold: Display custom message for products with salable quantity at or below threshold. Disable Add to cart button for products without salable quantity: Disable Add to cart button for products without salable quantity. Admin configuration: Admin configuration

Installation

Method 1: Composer (recommended)

composer require peterbrain/magento2-salable-qty

Method 2: Zip file (not recommended)

  • Unzip the zip file in app/code/PeterBrain

This extension is dependent on PeterBrain Core. Make sure that you have installed it first. Use Composer to install it automatically with this module.

Enable & deploy

php bin/magento module:enable PeterBrain_SalableQty
php bin/magento setup:upgrade
php bin/magento cache:flush

Usage

  • Enable module ouptut in Stores > Configuration > PeterBrain Extensions > Salable Quantity > General Configuration
  • Set a custom message for products with salable quantity is zero
  • Disable the add to cart button if salable quantity is zero
  • Set a custom minimum salable quantity threshold
  • Set a custom message for salable product quantity at or below the custom threshold

About

Display a custom message about the salable quantity on the product detail page. E.g. Only x items left! Disable the Add to cart button for products without salable quantity.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks