Stocks Upload
The task reports your products' stock to the Shopware shop, and nothing else. It is separate from Products Upload because stock changes far more often than a product does: that way a change in stock does not drag the whole product record along, and the task can run at a tight cadence while the product upload runs at night.
What gets transferred
One number per product goes into the shop, the stock. The transfer plan works out which number that is, and the preset is not a plain hand-over, see below.
TRADElube transfers only what has changed. A product whose stock stayed the same is skipped. That is why an execution across the whole catalogue shows only the ones that genuinely changed in the traces.
How the transfer plan is built
The plan carries three sections:
| Section | What sits in it |
|---|---|
| Selection | Condition, meaning which products go along at all, and Existing Item, meaning how TRADElube recognizes the counterpart in the shop |
| Common | The single assignment Stock, and that one is mandatory |
| Custom Fields | One pair of Field Name and Field Value per tab, for values Shopware does not know as stock |
The assignment Stock is preset as a script, not as a field assignment, and the calculation in it is the reason the stock in the shop is not simply your stock:
The stock of your first store plus the difference between the shop's stock and the stock available there.
The reason is double counting. On an order that has not shipped yet, Shopware subtracts the quantity from the available stock and remembers it as reserved. If that order reaches you through Orders Download and is subtracted from your stock as well, the quantity would be gone twice. The calculation therefore adds the reserved quantity back.
If you keep several stores, the first one is the preset, not their sum. There is one source per store. You decide in the script which stores are to reach the shop.
Custom Fields takes everything that is not stock. The field name is entered as a fixed value, because there is no lookup list of the custom fields present in the shop. As the value you can pick the stores, the product identifiers and your properties. That is the way to hand the shop another number besides the stock, the stock of a second store for instance.
Special features and limits
The task creates no product. It writes into a product that already exists in the shop. An article without a channel mapping is skipped, and the order is therefore always: Products Upload first, then the stock.
A stock of zero is a number like any other. It is transferred and sets the article to sold out in the shop instead of hiding it. Whether a sold-out article stays visible in the shop is the shop's decision.
The cadence belongs to the task, not to the channel. Because this task is small, it is the first one where a tight cadence pays off. The setting for it is Performance in the Common section, see Channels and tasks.
Further reading
- Shopware: prerequisites, connection, mappings and the other twelve tasks
- Products Upload (Shopware): the task that transfers the products themselves
- Stock (concepts): how TRADElube keeps stock per store
- Orders Download (Shopware): the way an order in the shop touches your stock
- Transfer plan (concepts): plan, section and assignment, plus the three ways to determine a value