Stock management
Each product in your store has a “Stock status” setting in the “General” tab of its product sheet. It determines whether the product can be ordered, in what quantity, and whether actual stock should be updated with each order.
The four possible settings
| Setting | What happens on your site |
|---|---|
| “No stock limit” | The product can be ordered in any quantity. No count is kept. |
| “Out of stock” | The product remains visible but cannot be added to the cart. Its product sheet displays “Out of stock.” |
| “Maximum quantity per order” | A customer cannot order more than the specified number at one time. This number never decreases: each customer can order this maximum. The product sheet displays “Maximum N per order.” |
| “Automatically managed stock” | Actual stock, kept for each variation, that decreases with every order placed on your site. The product sheet displays “Available stock: N,” then “Out of stock” when everything is sold. |
Setting up automatically managed stock
Managed stock is stored on your server, not in your project. This is what allows each order to decrease it, and ensures that publishing again never overwrites it. Two conditions are required:
- Your site uses HTTPS, and its address is entered with https:// in the publishing settings. WebAcappella refuses to read or modify stock over an unsecured connection.
- Your site has been published at least once with WebAcappella 4.2.8 or later.
The product itself does not need to be online yet: you can set its stock before it is first published.
- Open the product sheet, “General” tab.
- In the “Stock status” section, choose “Automatically managed stock.”
- Click “Manage online stock...”. The “Online stock” window displays one row per variation.
- Enter the stock for each variation in the “Online stock” column, then click OK.
- Confirm the product sheet with OK, then publish your site.
A product without variants has only one row, labeled “Product without variants.” For a product with variations, each combination (for example Red / M) has its own stock: a sold-out red T-shirt in M does not prevent selling the blue one in M.
Changing stock during sales
The “Online stock” window shows the stock of your published site at the moment you open it. Change a value and click OK: your site is updated immediately, without republishing. This is how you add spots, restock an item, or correct a count. The “Refresh” button reloads the values from the site.
The “Online payment in progress” column counts items reserved by customers who are currently paying by credit card or PayPal. During this time, other customers cannot order them. You don't need to deduct them yourself: they are removed from stock once payment is confirmed, or become available again after 30 minutes if the payment is abandoned.
A variation marked “Not published yet” is not on your site yet. The stock entered for it will apply as of the next publication.
When stock decreases and when it goes back up
Stock is reserved when the order is created, that is, when the customer reaches the “Payment” step. If there is no longer enough stock at that moment, the order is not created and the cart tells the customer which item to adjust.
| Situation | Effect on stock |
|---|---|
| Order paid by bank transfer, check, Swiss QR-bill, or cash on delivery | The items are removed from stock as soon as the order is created. |
| Order paid online (credit card, PayPal...) | The items are reserved for 30 minutes, then removed from stock when the bank confirms payment. If the customer abandons the payment, they become available again. |
| Payment manually set to “Payment validated” in order management (for example, the customer left before the bank responded) | The reservation becomes final. |
| Order set to “Order cancelled,” or payment set to “Payment error” or “Refunded” | The items are put back in stock. |
| Order cancelled, then restored | The items are taken from stock again, even if it ran out in the meantime (see below). |
| Order deleted while neither paid nor shipped (duplicate, test order, transfer never received) | The items are put back in stock. |
| Order deleted when already paid, shipped, or delivered | Stock does not change: a sold item does not return to stock. |
Restoring an order when stock has run out
If you restore a cancelled order whose items have been resold in the meantime, its items are still taken: the decision is yours. Stock then drops below zero, and order management displays a warning:
As long as stock remains negative or at zero, the product appears out of stock on your site. The “Online stock” window displays the negative value as is, so you can correct it with full knowledge of the situation.
What your customers see
- The product sheet displays the available stock: “Available stock: N.” Items being paid for online by other customers are already deducted.
- When the cart already contains all available stock, the add-to-cart button is replaced by “Maximum quantity reached.”
- If stock decreases while the customer is filling their cart, the cart indicates it and blocks checkout: “Only N item(s) of “Product” left. Please adjust the quantity to continue your purchase.”
- When everything is sold, the product sheet displays “Out of stock” and the product can no longer be added to the cart.
If an error message appears
The “Online stock” window explains each error and what to do. Here are the most common ones:
| The message says that... | What to do |
|---|---|
| your site's address starts with http, not https | Enable HTTPS with your hosting provider (most offer a free certificate), correct the address in the publishing settings, then publish your site. |
| online stock is not yet available on your site | Publish your site once with WebAcappella 4.2.8 or later, then try again. |
| your site redirects to another address | The address entered in the publishing settings must be exactly your site's address, with or without www. |
| the security key does not match | The site was published from another copy of your project. Publish it from the project you are using, then try again. |
| your computer's clock differs by more than 10 minutes from your site's clock | Set your computer to the correct date and time, then try again. |
Backing up the stock
The stock is saved on your server, in the /wa_shop_database/stock/ folder, alongside the orders. Like the orders, it is not included in a backup of your WebAcappella project. The order backup provided by order management contains the entire /wa_shop_database/ folder, stock included: keep this in mind before changing web hosts.