Appearance
How orders take stock
For merchants
Shopware already lowers a product's Stock when an order is placed and raises it again when the order is cancelled. The plugin makes the same change in the warehouses and then sets Stock back to the active-warehouse total.
This always happens. It cannot be switched off.
An order is placed
The ordered quantity is taken from the active warehouses in position order. The first warehouse is emptied before the next one is used.
| Warehouse | Position | Before | Order for 4 | After |
|---|---|---|---|---|
| Lagos | 1 | 3 | takes 3 | 0 |
| Abuja | 2 | 5 | takes 1 | 4 |
| Stock | 8 | 4 |
The plugin remembers, per order line, how much it took from which warehouse.
Inactive warehouses are never taken from. A product with no quantity in any active warehouse is left to Shopware alone: only its Stock changes.
More is ordered than the warehouses hold
Warehouses never go below 0. If an order takes more than the active warehouses hold, they are all emptied and Stock becomes 0. The missing pieces are not recorded against any warehouse.
To stop customers ordering more than you hold, use Shopware's Clearance sale (closeout) setting on the product. See Shopware: Products.
An order is cancelled
When an order is cancelled, or a line item is removed, the stock goes back to the warehouses it was taken from:
- Only what was recorded as taken goes back. Pieces that were never in a warehouse (an oversell, or an order placed before version 0.2.0) are not added.
- Stock is refilled in the reverse order it was taken: the warehouse with the highest position first.
- It goes back even to a warehouse that has been switched off since. It then does not count until you switch the warehouse on again.
- If the warehouse has been deleted since, nothing goes back for that part.
Stock is then set to the active-warehouse total.
Editing an order in the Administration
Editing an order's line items works the same way:
- Raising a quantity, or adding a line, takes more stock in position order.
- Lowering a quantity, or removing a line, puts stock back, highest position first.
- Deleting an order puts its stock back like a cancellation.
Example: Lagos (position 1) holds 5 and Abuja (position 2) holds 10. An order for 8 takes 5 from Lagos and 3 from Abuja. Lowering the order to 4 puts the 3 back into Abuja first, then 1 into Lagos.
Two orders at the same time
While one order takes stock from a product's warehouses, a second order for the same product waits. Two orders can never take the same pieces. The second gets what is left; anything beyond that is an oversell.
Returns
Returned goods are not put back into a warehouse. Shopware 6.7 does not restock returns either. Book returned stock in the product's Warehouse stock card or through your import.
Your ERP
If your ERP imports the quantities, the next import overwrites them, including what orders took since the last import. The ERP stays the owner of the numbers.
If something goes wrong
A failure while updating the warehouses never breaks checkout: the order is already saved at that point. The error is written to the plugin log, and the warehouse quantities for that change stay as they were. See Troubleshooting → Warehouse quantities did not change after an order.