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

# Product Rules

> Control which locations can fulfill specific products or collections

Product rules let you restrict fulfillment based on **what's in the cart**. When a customer orders specific products or items from certain collections, you can control exactly which locations are allowed to fulfill those items.

<Info>
  Product rules are ideal when certain items require special handling, packaging, or should only ship from locations with specific capabilities.
</Info>

## How product rules work

A product rule has two parts:

1. **When** (condition): Which products or collections trigger the rule
2. **Then** (filter): Which locations to block or allow when triggered

```mermaid theme={"system"}
flowchart LR
    A[Customer adds<br/>product to cart] --> B{Product matches<br/>rule condition?}
    B -->|No| C[All locations<br/>eligible]
    B -->|Yes| D[Apply location<br/>filter]
    D --> E{Filter action}
    E -->|Include| F[Only specified<br/>locations can fulfill]
    E -->|Exclude| G[Specified locations<br/>blocked]
```

## Create a product rule

<Steps>
  <Step title="Navigate to Fulfillment Constraints">
    Go to **Charlie → Fulfillment Constraints** and click **Create rule**.
  </Step>

  <Step title="Name your rule and set status">
    Enter a descriptive name (max 75 characters) that explains the rule's purpose, like "Fragile items - Warehouse only" or "Premium collection - Flagship stores".

    Set the **Status** to:

    * **Active**: Rule applies immediately at checkout
    * **Draft**: Rule is saved but won't affect checkout
  </Step>

  <Step title="Select Product based as the rule type">
    Under **Rule type**, select **Product based**.

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-product-rule-type.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=036c2ced7adff64a9e87fa240372bbbe" alt="Selecting Product based rule type" width="2522" height="1884" data-path="images/constraints-product-rule-type.png" />
    </Frame>
  </Step>

  <Step title="Configure the condition (When)">
    In the **Configuration** section under **When**, set up what triggers the rule:

    **Condition**: Choose between Product or Collection

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-product-condition.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=7ea1f3a5296795ecf53763cd67f77891" alt="Condition dropdown showing Product and Collection options" width="1932" height="2052" data-path="images/constraints-product-condition.png" />
    </Frame>

    **Operator**: Select how the condition matches

    | Operator             | Effect                                                      |
    | -------------------- | ----------------------------------------------------------- |
    | **Includes**         | Rule triggers when cart contains ANY of the selected items  |
    | **Does not include** | Rule triggers when cart does NOT contain the selected items |

    **Value**: Click **Select products** or **Select collections** to open the picker and choose your items.

    <Tabs>
      <Tab title="Product picker">
        Search and select individual products from your catalog.

        <Frame>
          <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-product-picker.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=329f09e4feac6d9df8a8125bc3d1ac32" alt="Product picker modal with search and product list" width="2434" height="2160" data-path="images/constraints-product-picker.png" />
        </Frame>
      </Tab>

      <Tab title="Collection picker">
        Select one or more collections. The rule will apply to all products within those collections.

        <Frame>
          <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-collection-picker.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=5e167b6e720629a1eef1618a2e5ec2e6" alt="Collection picker modal showing collections with product counts" width="2318" height="2188" data-path="images/constraints-collection-picker.png" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Configure the location filter (Then)">
    Under **Then**, define which locations are affected when the rule triggers:

    **Action:**

    | Action      | Effect                                                        |
    | ----------- | ------------------------------------------------------------- |
    | **Include** | Only the specified locations can fulfill (all others blocked) |
    | **Exclude** | The specified locations are blocked (all others allowed)      |

    **Property**: Choose how to target locations

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-product-property.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=8e239c886d0fd17483cc8e9f63b7737d" alt="Property dropdown showing Specific locations, Location with tag, and Location with type options" width="2436" height="2054" data-path="images/constraints-product-property.png" />
    </Frame>

    | Property               | Value                       | Use when                                         |
    | ---------------------- | --------------------------- | ------------------------------------------------ |
    | **Specific locations** | Select individual locations | You need precise control over specific locations |
    | **Location with tag**  | Enter tag names             | You want to target locations by capability       |
    | **Location with type** | Warehouse or Store          | You want to target all locations of a type       |
  </Step>

  <Step title="Save the rule">
    Click **Save** to create your rule. If set to Active, it takes effect immediately at checkout.
  </Step>
</Steps>

<Warning>
  You can create up to **10 configurable rules** total across Product, Customer, and Cart rule types. Plan your rules strategically.
</Warning>

## Configuration options

### Condition types

<Tabs>
  <Tab title="By Products">
    Target specific individual products by selecting them from your catalog.

    **Best for:**

    * One-off items with special requirements
    * Products that need specific handling
    * Items exclusive to certain locations

    **Example:** A hand-blown glass vase that requires specialized packaging only available at your main warehouse.
  </Tab>

  <Tab title="By Collections">
    Target all products within one or more collections.

    **Best for:**

    * Product categories with shared requirements
    * Seasonal items
    * Brand-specific fulfillment rules

    **Example:** All products in your "Oversized Furniture" collection that can only ship from locations with freight capabilities.

    <Tip>
      Using collections makes maintenance easier. When you add new products to a collection, they automatically inherit the rule.
    </Tip>
  </Tab>
</Tabs>

### Location filters

<AccordionGroup>
  <Accordion title="Filter by specific locations">
    Select individual locations from your list. Use this when you need precise control.

    **Example setup:**

    * Action: **Include**
    * Property: **Specific locations**
    * Value: Paris Warehouse, Lyon Warehouse

    **Result:** Only Paris and Lyon warehouses can fulfill matching products.
  </Accordion>

  <Accordion title="Filter by location tag">
    Target locations based on tags you've assigned. This is powerful for capability-based routing.

    **Example setup:**

    * Action: **Include**
    * Property: **Location with tag**
    * Value: `hazmat-certified`

    **Result:** Only locations tagged `hazmat-certified` can fulfill matching products.

    <Info>
      Make sure you've [set up location tags](/locations/tags) before using this filter.
    </Info>
  </Accordion>

  <Accordion title="Filter by location type">
    Target all Warehouses or all Stores at once.

    **Example setup:**

    * Action: **Exclude**
    * Property: **Location with type**
    * Value: Store

    **Result:** All stores are blocked; only warehouses can fulfill matching products.
  </Accordion>
</AccordionGroup>

## Examples

### Fragile items from warehouse only

A home décor retailer sells delicate glass items that require bubble wrap and custom packaging only available at their central warehouse.

<Steps>
  <Step title="Create a collection">
    In Shopify, create a collection called "Fragile Items" and add all glass products.
  </Step>

  <Step title="Create the rule">
    * **Name:** Fragile items - Warehouse only
    * **Status:** Active
    * **Type:** Product based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Collection
    * **Operator:** Includes
    * **Value:** Fragile Items collection
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Include
    * **Property:** Location with type
    * **Value:** Warehouse
  </Step>
</Steps>

**Result:** Glass items can only be fulfilled from warehouses, never from retail stores.

***

### Exclusive products for flagship stores

A fashion brand launches a limited collection only available at their 3 flagship stores.

<Steps>
  <Step title="Tag your flagship stores">
    Go to [Locations](/locations/overview) and add the tag `flagship` to your 3 flagship stores.
  </Step>

  <Step title="Create the rule">
    * **Name:** Limited collection - Flagship only
    * **Status:** Active
    * **Type:** Product based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Collection
    * **Operator:** Includes
    * **Value:** Limited Edition Fall 2024
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Include
    * **Property:** Location with tag
    * **Value:** `flagship`
  </Step>
</Steps>

**Result:** Limited edition items can only be fulfilled from flagship stores.

<Tip>
  When the collection ends, simply set the rule to **Draft** or delete it. No need to update individual products.
</Tip>

***

### Heavy items excluded from small stores

A furniture retailer has small urban stores that can't handle oversized deliveries.

<Steps>
  <Step title="Tag small stores">
    Add the tag `small-footprint` to stores with limited space.
  </Step>

  <Step title="Create the rule">
    * **Name:** Heavy items - No small stores
    * **Status:** Active
    * **Type:** Product based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Collection
    * **Operator:** Includes
    * **Value:** Oversized Furniture, Heavy Appliances
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Exclude
    * **Property:** Location with tag
    * **Value:** `small-footprint`
  </Step>
</Steps>

**Result:** Heavy items skip small stores entirely, routing to larger locations or warehouses.

## Best practices

<CardGroup cols={2}>
  <Card title="Use collections over products" icon="layer-group">
    Collections automatically include new products, reducing maintenance. Reserve individual product selection for true one-offs.
  </Card>

  <Card title="Use tags for capabilities" icon="tags">
    Tag locations by what they can do (`fragile-certified`, `cold-chain`, `oversized-shipping`) rather than what they are.
  </Card>

  <Card title="Test with Draft status" icon="flask">
    Create rules in Draft mode first, verify the logic, then activate. This prevents unexpected checkout blocks.
  </Card>

  <Card title="Name rules clearly" icon="pen">
    Use descriptive names like "Hazmat items - Certified locations only" instead of "Rule 1". Future you will thank you.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Customers see 'no shipping options' at checkout">
    This means all locations with stock are blocked by your rule.

    **Check:**

    1. Does at least one allowed location have the product in stock?
    2. Is the filter too restrictive? (e.g., including only one location that's out of stock)
    3. Are multiple rules conflicting and blocking all locations?

    **Quick fix:** Set the rule to Draft temporarily to restore checkout.
  </Accordion>

  <Accordion title="Rule doesn't seem to apply">
    **Check:**

    1. Is the rule status set to **Active**?
    2. Does the product/collection in cart actually match the condition?
    3. If using "Does not include", remember the logic is inverted

    **Debug tip:** Place a test order with the exact products and verify which location fulfills it.
  </Accordion>

  <Accordion title="Can't create more rules">
    You've reached the limit of 10 configurable rules (Product + Customer + Cart combined).

    **Solutions:**

    * Consolidate similar rules using collections instead of individual products
    * Delete unused or Draft rules
    * Use location tags to make rules more flexible
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Customer Rules" icon="user" href="/constraints/customer-rules">
    Restrict locations based on who is buying
  </Card>

  <Card title="Cart Rules" icon="cart-shopping" href="/constraints/cart-rules">
    Restrict locations based on cart properties
  </Card>

  <Card title="Location Tags" icon="tags" href="/locations/tags">
    Set up tags to use in your rules
  </Card>

  <Card title="Order Routing" icon="route" href="/order-routing/overview">
    Prioritize locations instead of blocking them
  </Card>
</CardGroup>
