> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aftersell.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding out of stock variants

> This article explains how Aftersell handles out-of-stock variants for upsell products on the post purchase page

# **Overview**

Upsell products may have one or multiple variant options (such as size or color). Aftersell handles out-of-stock variants differently depending on how many options a product has, to ensure a smooth customer experience and prevent unavailable selections.

***

# **Out of Stock Variant Logic**

### **Products with a Single Variant Option**

If a product has **only one variant option** and that variant is **out of stock**, it is **hidden entirely.** For example,

* The blue variant for this Notebook product is out of stock

  <img src="https://mintcdn.com/aftersell/1Y3gBpUfxv16VGSW/images/aftersell/out-of-stock-variants-select-products-dialog-notebook.png?fit=max&auto=format&n=1Y3gBpUfxv16VGSW&q=85&s=3b2b7930e45c41602ffcc80cb43c0ee7" alt="Select Products dialog showing the Notebook Blue variant marked Out of Stock" width="1498" height="1160" data-path="images/aftersell/out-of-stock-variants-select-products-dialog-notebook.png" />

* Therefore, on the post purchase page, the blue variant will not show up as an option

  <img src="https://mintcdn.com/aftersell/1Y3gBpUfxv16VGSW/images/aftersell/out-of-stock-variants-post-purchase-notebook-colour.png?fit=max&auto=format&n=1Y3gBpUfxv16VGSW&q=85&s=18efb2a353ed98f75d62f117a38c5090" alt="Post-purchase page with the Notebook colour dropdown listing only White and Black" width="1942" height="1082" data-path="images/aftersell/out-of-stock-variants-post-purchase-notebook-colour.png" />

This prevents customers from interacting with a product that cannot be fulfilled.

***

### **Products with Multiple Variant Options**

If a product has multiple variant options, **all variant options are displayed**, including those that are out of stock. By default, Aftersell will **preselect an in-stock variant**, if one is available. However, if a customer manually selects an **out-of-stock variant**, it will be clearly marked as **unavailable** and cannot be added.

For example,

* The blue/small variant for this T-shirt product is out of stock

  <img src="https://mintcdn.com/aftersell/1Y3gBpUfxv16VGSW/images/aftersell/out-of-stock-variants-select-products-t-shirt.png?fit=max&auto=format&n=1Y3gBpUfxv16VGSW&q=85&s=6c809a3947f91e6d155406de2fe7aa07" alt="Select Products dialog showing the T-shirt blue Small variant marked Out of Stock" width="1190" height="934" data-path="images/aftersell/out-of-stock-variants-select-products-t-shirt.png" />
* However, the variant will still appear on the live post-purchase page, but customers will not be able to purchase it if selected.

  <img src="https://mintcdn.com/aftersell/1Y3gBpUfxv16VGSW/images/aftersell/out-of-stock-variants-t-shirt-unavailable-button.png?fit=max&auto=format&n=1Y3gBpUfxv16VGSW&q=85&s=ffa02729600a64af9257b90fae58299b" alt="Post-purchase T-shirt offer with an out-of-stock variant showing an Unavailable button" width="1530" height="854" data-path="images/aftersell/out-of-stock-variants-t-shirt-unavailable-button.png" />

This approach gives customers full visibility into available options while preventing invalid selections.

**NOTE:** This logic applies even if all variant settings are unchecked in the editor.

***

# **Pre-Order and Pre-Sale Variants**

The out-of-stock logic above applies to variants that can no longer be sold once their inventory runs out — Shopify's default **"Stop selling when out of stock"** behavior.

Pre-order and pre-sale variants are handled differently. In Shopify, these variants have **"Continue selling when out of stock"** enabled (an inventory policy of *continue*). Aftersell checks a variant's inventory **policy**, not just its quantity on hand, so a continue-selling variant is treated as **available** even when its tracked inventory is 0 or negative.

As a result, pre-order/pre-sale variants behave like in-stock variants on the post-purchase page:

* **Single variant option:** the variant is **shown** (not hidden), and customers can add it.
* **Multiple variant options:** the variant is **selectable and purchasable** — it is not marked as unavailable.

This lets you run pre-order or pre-sale offers as post-purchase upsells without the variant being suppressed for having no stock on hand.

<Note>
  To enable this behavior, turn on **Continue selling when out of stock** for the variant in Shopify (under the product's variant **Inventory** settings). A variant left on the default *stop selling when out of stock* follows the out-of-stock logic described above once its inventory reaches 0.
</Note>

<Note>
  Exception: if your offer is configured to hide products that are out of stock, continue-selling variants with 0 or negative inventory are hidden along with regular out-of-stock variants.
</Note>

***

# **Hiding variants that aren't published to your Online Store**

By default, Aftersell can offer variants that are in stock but excluded from your Online Store sales channel in Shopify — for example, variants you keep available for retail or wholesale but deliberately hide from your web storefront.

To stop those variants appearing in post-purchase offers, go to **Settings → Inventory**, find the **Unpublished variants** section, and tick **Hide unpublished variants from post-purchase offers**. The setting is off by default.

## How it works

With the setting on, Aftersell checks each variant's publication status on the Online Store sales channel before including it in an offer. Variants that aren't published are excluded. If every variant of a product is excluded, the product is dropped from the offer entirely.

The filter applies to both live offers and the offer editor preview, so what you see in the editor matches what customers get.

<Note>
  This setting needs the `read_publications` permission in Shopify. Ticking the box prompts you to grant it, and the setting only takes effect once you accept.
</Note>

<Warning>
  The check is **fail-open**. If the permission is missing, or the lookup to Shopify errors or times out, the variant is still offered rather than hidden. Treat this as a merchandising preference rather than a guarantee that an unpublished variant can never appear.
</Warning>
