Skip to content

Stock display

Steps for

How it works

SparkLayer reads stock from your eCommerce platform, or from your own system if you send it through the SparkLayer API. Whether you manage stock by hand or from an ERP, B2B customers see the same numbers. The customer group's stock display settings then decide how customers see that stock.

How a stock status reaches the customer

Stock in your platform

Quantities and "continue selling" settings for each variant
(this flows forward)

Customer group rules

Whether to show stock, exact units, and the max, low and last thresholds
(this flows forward)

Status shown

In stock, low stock, last stock, out of stock or pre-order, in the frontend interfaces

How the status is chosen

SparkLayer works from the available quantity of each variant. On Shopify, that's the Available quantity: stock on hand minus units committed to open orders. For example, 1 unit on hand that's committed to an order counts as 0 available, so with Continue selling when out of stock on, the variant shows as pre-order.

Customers see one of these statuses, each with a coloured dot:

StatusColourWhen it shows
In stockGreenAvailable stock is above the Low threshold. If you show units, stock above Max shows as, for example, 100+.
Low stockAmberAvailable stock is above 0 and at or below the Low threshold. Customers see the number of units left.
Last stockAmberOnly the last items are left, as set by the Last threshold.
Pre-orderBlueAvailable stock is 0 or less, and your platform allows the variant to be sold when it's out of stock. See pre-orders and back-orders.
Out of stockRedAvailable stock is 0 or less, and selling when out of stock is off. The variant can't be ordered.
UnavailableRedUsually, the customer's price list has no B2B price for the variant. See Why a product shows Unavailable. It also shows when the variant has been made un-sellable: see How products are shown. To show "Price on application" instead, see Show "price on application".

Stock labels that come from your own theme, rather than from SparkLayer's interfaces, aren't changed by any of the settings on this page.

Which setting hides which label

All of these are in the customer group's Stock display rule, at Customers,Groups (opens in your SparkLayer Dashboard in a new tab):

To hideDo this
In stock, Low stock, Last stock and Out of stockUntick Show stock availability to customers. This doesn't hide the pre-order label.
The Pre-order labelTick Hide pre-order.
The exact number of unitsUntick Show number of units of stock.

Show stock levels to customers

You choose what each customer group sees. Stock display settings need version 2.0 or later of the Core Script, the SparkLayer code in your theme. If you're not sure which version you have, ask your developer or see How do I show stock on a SparkLayer version before 2.0?.

  1. Go to Customers,Groups (opens in your SparkLayer Dashboard in a new tab) and click a group's name. To apply the settings to every group, click Edit on the base customer group instead: the other groups inherit from it.
  2. Under Inherited rules, click + Override next to Stock display (on the base group, + Customize). The rule moves up to Customized rules.
  3. Click Configure and tick Show stock availability to customers.
  4. To show exact numbers, tick Show number of units of stock and enter the Max, Low and Last values.
  5. Click Save.

Changes to a customer group's rules apply straight away. There's nothing to publish and no sync to wait for.

SettingWhat it does
Show stock availability to customersCustomers see the stock status of each product and variant. Pre-order is always shown unless Hide pre-order is ticked.
Hide pre-orderHides the pre-order stock status from customers.
Show number of units of stockShows the exact stock number, up to the Max value.
MaxThe highest number shown, in green. Anything above shows as, for example, 100+.
LowThe low stock threshold. Low stock shows in amber.
LastThe last stock threshold, for the last remaining items.

Show the stock key on desktop

On smaller screens, customers see a stock key under the variants table in the product detail interface when stock display is on. It explains each colour: In stock, Out of stock, Pre-order, Low stock and Last stock.

To show the stock key on larger screens too, you or your developer add this line to your custom CSS:

--spark-pdp-stock-key-desktop: flex;

Set a stock level display limit

To cap the stock number customers see on product pages, go to Settings,Configurations (opens in your SparkLayer Dashboard in a new tab) and enter a number in Stock level display limit. For example, with a limit of 100, customers see 100+ when you have more than 100 in stock.

Show stock on product cards

The product card interface can show customers live stock on collection pages too. See Show stock status.

Allow pre-orders and back-orders

Customers can add a pre-order (or back-order) product to an order even when it's out of stock. They see a pre-order message next to it, such as On Backorder or Pre-order.

Set up pre-orders on Shopify

Shopify only

  1. In the Shopify admin, open the product or variant.
  2. In the inventory section, tick Track quantity and Continue selling when out of stock.
  3. Set the Available quantity to 0 or less, then click Save.

"Continue selling when out of stock" applies to retail customers too, so they can also buy more than you have. To limit this, you can create separate products that only B2B customers see. See Sell pre-order products to B2B customers only.

On other platforms, see the developer docs. Pre-orders and back-orders aren't supported on BigCommerce (see Compare platforms).

Change the pre-order message

You can change the pre-order message customers see without code. At Storefront,Options,Translation overrides (opens in your SparkLayer Dashboard in a new tab), add a translation override for pdp.messaging.back-order (product page) and product-card.messaging.back-order (product cards). See Languages and international.

For developers: set the text in the Core Script
Core Script
translations: {
  en: {
    "pdp.messaging.back-order": "Pre-order",
    "product-card.messaging.back-order": "Pre-order",
  }
},

Limit how many units can be pre-ordered

You can set exactly how much stock of a variant customers can pre-order or back-order. Use the sparklayer.min_stock_level metafield, entered as a negative number: -20 lets customers order until stock reaches -20.

  1. Make sure the field exists. On Shopify, go to Integrations,Platform (opens in your SparkLayer Dashboard in a new tab) and, in the Metafields card, click Configure next to SparkLayer metafields. On other platforms, use the metafield reference.
  2. On each variant, set sparklayer.min_stock_level to a negative whole number, for example -6, -12 or -20.

Lots of products? Fill them in one tableShopify

In your Shopify admin, go to Products, tick the products and click Edit products. Click Columns, tick the SparkLayer field under Metafields, then type the values (each variant has its own row) and click Save. Shopify's guide

Set a different limit for each stock location

If you use stock locations, you can set the level for each location instead, with the sparklayer.stock_location_data field. Enter each location's ID from your eCommerce platform and its limit, and the form writes the value, for example [{"location_id":"123","min_stock_level":-150}]:

Build the value Fill in what you need and leave the rest blank.
Paste into sparklayer.stock_location_data
Fill in a value above

Show a restock date

A restock date tells customers when a pre-order product is expected, for example "Pre-order. Expected shipping date: 17th April". Use it for a "due in" date (when you expect stock) or an "estimated shipping" date (when you expect to ship).

  1. Make sure the sparklayer.restock_date field exists. On Shopify, go to Integrations,Platform (opens in your SparkLayer Dashboard in a new tab) and click Configure next to SparkLayer metafields: it adds B2B - Restock Date. On other platforms, create it with the type date (see the metafield reference).
  2. On each variant, set the date, for example 17/11/2022 for the UK format.

Lots of products? Fill them in one tableShopify

In your Shopify admin, go to Products, tick the products and click Edit products. Click Columns, tick B2B - Restock Date under Metafields, then type the values (each variant has its own row) and click Save. Shopify's guide

Set a different restock date for each stock location

If you use stock locations, you can set a restock date for each location with the sparklayer.stock_location_data field. Enter each location's ID and pick its date, and the form writes the value, for example [{"location_id":"123","restock_date":"2023-12-12"}]:

Build the value Fill in what you need and leave the rest blank.
Paste into sparklayer.stock_location_data
Fill in a value above

To change the restock date wording, add a translation override for pdp.messaging.back-order-due at Storefront,Options,Translation overrides (opens in your SparkLayer Dashboard in a new tab). In the text, {restockDate} is replaced with the date.

For developers: set the text in the Core Script
Core Script
translations: {
  en: {
    "pdp.messaging.back-order-due": "Due {restockDate}",
  }
},

The product matrix can show restock dates too, with the show-restock-date setting.

Sell pre-order products to B2B customers only

If you sell to retail (DTC) and B2B customers from one store, you may want B2B customers to pre-order products that retail customers can't buy, for example a pre-season range.

Shopify only

Shopify can't hide or show products, or single variants, by customer type on its own. Make the pre-order version a separate product:

  1. Create a new product (or range) and set it up as normal, with images and descriptions.
  2. Tag it b2b-only with the free B2B Catalogs app, so only signed-in B2B customers see it.
  3. In SparkLayer, set up B2B pricing and any settings the products need, such as quantity rules.

Retail customers then can't see these products. This duplicates some product data, but it keeps pre-order products for B2B customers only. A product already in a cart, or added with an add-to-cart link, can still be bought: see B2B Catalogs limitations.

Tag orders that contain pre-order products (Shopify)

Shopify only

The Shopify Flow (opens in a new tab) app can tag orders that contain pre-order products automatically, so your team can find and handle them separately.

The sample Shopify Flow workflow

Order created

The workflow starts when an order (or draft order) is created
(this flows forward)

Check product tags

Checks whether a product's tags include b2b-pre-order
(this flows forward)

Tag the order

Adds the order tag b2b-pre-order
(this flows forward)

Add a note

Updates the order note to say the order contains pre-order items and may need review before fulfilment

Tag your pre-order products

In the Shopify admin, add the tag b2b-pre-order to each product you're selling on pre-order or back-order.

Tag orders with Shopify Flow

Install the Shopify Flow app (opens in a new tab) and create 2 workflows, one starting from Order created and one from Draft order created. In each, check whether any line item's product has the tag b2b-pre-order, and if it does, add the tag b2b-pre-order to the order. Once they're turned on, orders and draft orders containing pre-order products get the tag. Our support team can help you set them up.

Filter your orders

In the Shopify admin, go to Orders (opens in your Shopify admin in a new tab), click Add filter and filter by the tag b2b-pre-order. You can save this as a view, for example Pre-Order, and use it for your internal workflows, such as how you fulfil these items.

Hide pre-order messages

Customers see a product as pre-order when it meets your store's pre-order criteria. On Shopify, that's when Track quantity is on, Continue selling when out of stock is on, and the Available quantity is 0 or less. You can hide the message in 2 ways:

WhereHowEffect
In SparkLayerGo to Customers,Groups (opens in your SparkLayer Dashboard in a new tab), open a customer group and, in its Stock display rule, tick Hide pre-order.The pre-order status is hidden in the frontend interfaces for that group.
On ShopifyTurn off Track quantity or Continue selling when out of stock for the product or variant.The product is no longer treated as pre-order. On other platforms, see the developer docs.

Stock locations (inventory locations)

If your store keeps stock in several locations, for example by region, you can choose which location's stock a customer group sees. Stock locations need the Growth plan or above.

  1. Go to Settings,Configurations,Ordering (opens in your SparkLayer Dashboard in a new tab) and turn on Multi-location stock, then save.
  2. Go to Customers,Groups (opens in your SparkLayer Dashboard in a new tab) and click a group's name.
  3. Under Inherited rules, click + Override next to Stock location, then Configure.
  4. Select a location, for example London Warehouse.
  5. Click Save. Reset hands the rule back to the base group.

Until a group has a stock location, customers see combined stock from all locations. Each customer group can use one location.

This only changes the stock customers see. It doesn't change which location fulfils the order in your eCommerce platform.

On Shopify, your active locations sync to SparkLayer automatically. On other platforms, stock locations are managed through the Stock API. See Set a stock location for the setup needed on each platform.

Reserve stock for retail customers

If you run retail (DTC) and B2B from one store, both share the same stock, so large B2B orders could leave nothing for retail customers. A reserve stock quantity keeps some stock back for retail:

How reserved stock works, with a reserve of 50

Reserve set

You set a reserve stock quantity on a variant, for example 50
(this flows forward)

Both can order

Retail and B2B customers can both order the product
(this flows forward)

Stock reaches 50

B2B customers can no longer add it to their order
(this flows forward)

Retail keeps ordering

Retail customers can still buy the reserved stock

To set it:

  1. Make sure the sparklayer.reserve_stock_quantity field exists. On Shopify, go to Integrations,Platform (opens in your SparkLayer Dashboard in a new tab) and, in the Metafields card, click Configure next to SparkLayer metafields: it adds B2B - Reserved DTC Stock Quantity. On other platforms, see the metafield reference.
  2. On each variant, enter the quantity to keep back, for example 50, and save.

Lots of products? Fill them in one tableShopify

In your Shopify admin, go to Products, tick the products and click Edit products. Click Columns, tick B2B - Reserved DTC Stock Quantity under Metafields, then type the values (each variant has its own row) and click Save. Shopify's guide

To reserve a different amount for each customer group, use Product rules per customer group.

Change stock status messages

When stock display is on, you can change the wording of each stock status customers see. You don't need code: add a translation override for its key at Storefront,Options,Translation overrides (opens in your SparkLayer Dashboard in a new tab). See Languages and international.

KeyDefault text
pdp.messaging.back-orderPre-order
pdp.messaging.back-order-dueDue {restockDate}
pdp.messaging.out-of-stockOut of stock
pdp.messaging.low-stockLow stock
pdp.messaging.last-stockLast stock
pdp.messaging.in-stockIn stock
pdp.messaging.un-sellableUnavailable
For developers: set the text in the Core Script
Core Script
translations: {
  en: {
    "pdp.messaging.back-order": "Pre-order",
    "pdp.messaging.back-order-due": "Due {restockDate}",
    "pdp.messaging.out-of-stock": "Out of stock",
    "pdp.messaging.low-stock": "Low stock",
    "pdp.messaging.last-stock": "Last stock",
    "pdp.messaging.in-stock": "In stock",
    "pdp.messaging.un-sellable": "Unavailable",
  }
},

Metafield reference

This reference is for whoever sets up your product data. All of these are variant metafields with the namespace sparklayer. On Shopify, create them at Settings,Custom data,Variants (opens in your Shopify admin in a new tab). On other platforms they're variant-level product fields: see the developer docs and your platform's metafields guide.

KeyTypeValueUsed for
min_stock_levelintegerA negative whole number, for example -6, -12 or -20Limit pre-order quantity
restock_datedateA date in your store's format, for example 17/11/2022 (UK)Restock date
stock_location_datajsonOne entry per location, with the location_id from your platform and a min_stock_level and/or restock_date (YYYY-MM-DD)Per-location pre-order limits and restock dates (Shopify)
reserve_stock_quantityintegerA whole number, for example 50Reserved stock

Troubleshooting

FAQs

Was this page helpful?

Last updated