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

# Sell-out pin deletion

> Automatically remove pinned products when they sell out, with support for per-rule toggles and location-based inventory filtering.

Merchandising rules can automatically remove pinned products when they sell out, keeping your collection pages fresh without manual intervention. This feature operates at two levels: **per-rule** and **store-wide with location filtering**.

## Per-rule sell-out deletion

Each merchandising rule has a **Delete Pins on Sell Out** toggle. When enabled, any pinned product in that rule is automatically removed if it becomes unavailable (sold out globally). This is evaluated whenever a product's inventory is updated.

**How it works:**

* When a product's inventory reaches zero and it is no longer available for sale, Layers deletes its pin from the rule
* Layers updates the pin count for the rule automatically
* Layers flushes the rule's cache so the change takes effect immediately on the storefront
* If the product comes back in stock, you need to re-pin it manually

<Note>
  If the store-level **Auto-delete rule pins on product removal** setting is enabled, pins are deleted on sell-out for **all** rules regardless of each rule's individual toggle.
</Note>

## Location-based inventory filtering

For stores with multiple fulfillment locations, Layers supports **location-based sell-out checks**. Instead of relying on global inventory, you can specify which Shopify locations should be considered when determining if a product is "sold out" for pin deletion purposes.

This is configured in the dashboard under **Settings → Search Behavior → Sell Out Check Locations**.

**How location filtering works:**

* Select one or more Shopify locations from the multi-select picker
* A product is considered "sold out" only when it has zero inventory at **all** selected locations
* Products that are not tracked at any of the selected locations are **not** treated as sold out (no false positives)
* The check runs both during bulk inventory evaluation and when individual products are updated
* Leave the location selection empty to use global inventory (default behavior)

**Use cases:**

* **Regional fulfillment**: Only unpin products when they sell out at your primary warehouse, even if stock remains at a secondary location
* **Retail vs. online**: Track sell-out based on your online fulfillment center, ignoring retail store inventory
* **Multi-warehouse operations**: Consider a product sold out only when all key warehouses are empty

<Note>
  Location-based sell-out filtering applies store-wide to all rules that have **Delete Pins on Sell Out** enabled (or when the store-level auto-delete setting is active). You cannot configure different location filters per rule.
</Note>

## See also

* [Pins & Media Overrides](/platform/merchandising/pins)
* [Merchandising Rules](/platform/merchandising)
