vendic / magento2-stock-change-after-payment
Magento 2 module to decrease/increase product stock after invoice/creditmemo creation event
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 1
Open Issues: 1
Type:magento2-module
Requires
- php: ~7.0.0|~7.1.0|~7.2.0
- magento/magento-composer-installer: *
This package is auto-updated.
Last update: 2024-11-21 16:36:25 UTC
README
A simple Magento 2 extension that uses the sales_order_invoice_pay
and sales_order_creditmemo_refund
events to decrease/increase product quantity. It also adjusts the product stock status.
Default Magento 2
- An order is placed
- The product stock quantity is decreased with the ordered quantity
- Payment is made or canceled.
- Depending on this event it stays decreased (succesfull payment) or is added again (unsuccesfull payment)
Changes after using this module
- An order is placed
- The order is paid
- The product stock quantity is decreased with the ordered quantity
Result: stock is not decreased (reserved) for unpaid orders.
Installation
In vanilla Magento 2.2, the product stock is 'reserved' (substracted) when an order is placed, so we'll have to disable this system so we can replace it with our own.
-
Set 'Decrease Stock When Order is Placed' to 'No' to disable. You can find it here: Stores > Inventory > Stock Options
-
Install via composer:
comoser require vendic/magento2-stock-change-after-payment
About Vendic
Vendic - Magento 2 develops technically challenging e-commerce websites using Magento 2. Feel free to check out our projects on our website.