Simple Commerce Logo

Stock

Enabling

Standard Product

To start using the stock functionality built into Simple Commerce, you'll need to add an Integer field, with the handle of stock to your product blueprint.

After that, you can populate your products with the correct amount of stock. Then, whenever a customer purchases that product, the stock count will be decreased.

Variant Product

To start using the stock functionality with variant products, you'll need to add an 'option field' to your Product Variants field, with the handle of stock and using the Integer fieldtype.

Stock Variant Options

After that, head into your products and populate your variants with the correct amount of stock. Then, whenever a customer purchases that variant, the stock count will decreased.

Events

Simple Commerce will fire events when either your stock is running low or if your stock has ran out for one of your products.

You can configure the threshold for when you want to start dispatching the StockRunningLow event in your simple-commerce.php config.

1/*
2 |--------------------------------------------------------------------------
3 | Stock Running Low
4 |--------------------------------------------------------------------------
5 |
6 | Simple Commerce can be configured to emit events when stock is running low for
7 | products. Here is where you can configure the threshold when we start sending
8 | those notifications.
9 |
10*/
11 
12'low_stock_threshold' => 25,

Need some help?

There's plenty of ways of getting help: either via opening a GitHub Issue, starting a conversation on the Statamic Discord or directly emailing me.