DC Transactional stock
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
This project is now obsolete.
Use Commerce transactional stock feature with Commerce_stock if you need a transactional stock system on top of Commerce Stock v1.
Also follow #1269168: Commerce_stock for D7 & D8 Roadmap for next commerce stock version.
Transactional stock system for Drupal Commerce.
Basically the system works as follow :
1/ Add a stock field to your product
2/ Create a stock entry for a specific SKU and field with a quantity
3/ A hook is "linking" the 2 modules (stock entries and stock) to automatically update the quantity of stock remaining for a product. Typically, you create a stock entry with positive value when you receive goods, and create a stock entry with negative value when a product is sold. Hooks will be automatically triggered to reflect the stock variation of the product.
4/ You can set up rules to automatically create the stock entry based on the workflow you want (typically, order states)
I create the following rules :
a) create stock entry on order update (check the order status to see if the stock should be decremented at this stage, and loop over all the line items of the order)
b) delete stock entry on order update (check the order status to see if the stock should be impacted it this stage, say the order has been cancelled or is back to cart status, you probably don't want your stock to be decremented)
c) delete stock entry on order delete