> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.delm.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# What are exceptions and how do they work?

Delm uses a powerful **Rule Engine** to calculate delivery dates. This system is designed to be both **Flexible** and **Scalable**.

* **Flexible:** You have granular control over every step of the delivery promise. You can change your *Processing Time* without affecting your *Transit Time*, or create a specific schedule just for international orders without breaking your domestic setup.
* **Scalable:** You can manage delivery times for thousands of products as easily as ten. Instead of editing products one by one, you create a single **Exception** (e.g., based on a "Collection" or "Tag"), and it automatically applies to every matching item in your store.

Each step of the delivery process has a **Default Rule** and the option to add **Exceptions**. The Default Rule applies to everything unless an Exception specifically overrides it.

| Rule Type | Best Used For |
| ---- |
| **Visibility** | Hiding the delivery widget for specific products. |
| **Processing Time** | Setting longer lead times for custom or made-to-order items. |
| **Processing Schedule** | Defining different working days for specific warehouses. |
| **Shipping Schedule** | Adjusting shipping days for specific carriers. |
| **Transit Time** | Increasing transit estimates for international shipments. |
| **Transit Schedule** | Customizing transit days for specific regions. |
| **Delivery Schedule** | Limiting delivery days (e.g., no weekends) for certain products. |

---

## Adding conditions to an Exception

Apply **Conditions** to control exactly when an Exception is triggered. An Exception only becomes active if **all** of its conditions are met. 

| Condition | Description |
| ---- |
| **Product** | Specific products or variants. |
| **Collection** | Specific collections. |
| **Tag** | Products with specific tags. |
| **Vendor** | Products from specific vendors. |
| **Product Title** | Matches the product title using text patterns. |
| **Variant Title** | Matches the variant title using text patterns. |
| **SKU** | Matches the SKU using text patterns. |
| **Product Availability** | Products that are in-stock vs. out-of-stock. |
| **Stock** | Total inventory count across all locations. |
| **Inventory Location** | Products stocked at specific warehouse locations. |
| **Shipping Country** | The customer's shipping destination (see note below). |
| **Current Date** | Compares the current date. |

> **Note on Shipping Country:** By default, Delm uses the customer's **IP address** to detect their location. If you prefer to use the country selected in the store, you can change this in the **Delm Core** app embed settings.

---

## How Exceptions are prioritized

When a customer views a product, Delm evaluates your settings to find the single best match.

1. **Top-to-Bottom Evaluation:** Delm checks your list of Exceptions from top to bottom.
2. **First Match Wins:** The **first Exception** where the context (Product, Date, Country) matches the conditions is the one used.
3. **Termination:** Once a match is found, the evaluation stops. Any Exceptions further down the list are ignored.
4. **Default Fallback:** If no Exceptions match the conditions, the **Default Rule** for that category is automatically applied.

---

## Preview and testing

You do not have to guess if your Exceptions are working. Use the **Preview** tool to simulate real customer scenarios and verify exactly which rules are being applied.

1. Go to the **Preview** section in Delm.
2. Input a context: Select a specific **Product variant**, a **Start date**, and a **Shipping country**.
3. The system runs the calculation and highlights exactly which Exception was picked for visibility, processing, shipping, transit, and delivery.
4. Look for the **green checkmark** icon next to the active exceptions.

![Preview](https://storage.crisp.chat/users/helpdesk/website/-/a/4/8/8/a488abe1860c5800/preview_1628gk8.png)