# Create a rule

## Steps

1. Go to **Variant Drawer** in the app menu
2. Click **Create rule**
3. Fill in the rule details (see fields below)
4. Click **Save**

After saving, the rule editor opens with a live preview panel where you can fine-tune every setting.

***

## Rule fields

### General

| Field        | Description                                                                    |
| ------------ | ------------------------------------------------------------------------------ |
| **Title**    | Internal name for your reference (not shown to customers)                      |
| **Status**   | Active or Inactive. Inactive rules are saved but not applied on the storefront |
| **Priority** | Higher number = wins when multiple rules match the same product. Default is 0  |

### Customer eligibility

| Option                  | Who sees the drawer                             |
| ----------------------- | ----------------------------------------------- |
| **All customers**       | Everyone visiting your store (including guests) |
| **Logged-in customers** | Any customer with an account                    |
| **Guest visitors**      | Customers not logged in                         |
| **Customer tags**       | Only customers with specific Shopify tags       |

You can also select **Customer Groups** created in the app. The group's tag is used for matching.

**Excluded customers** — Optionally block specific individual customers even if they match the tag or group.

### Market eligibility

| Option               | Description                                        |
| -------------------- | -------------------------------------------------- |
| **All markets**      | The drawer appears in every Shopify Market         |
| **Specific markets** | Only in selected markets (e.g. only for US market) |

### Product eligibility

| Option                   | Which products show the drawer          |
| ------------------------ | --------------------------------------- |
| **All products**         | Every product in your store             |
| **Specific products**    | Only selected products                  |
| **Specific collections** | All products in selected collections    |
| **Product tags**         | All products with matching Shopify tags |

**Excluded products** — Optionally exclude specific products or entire collections from the rule, even if they match the product eligibility above.

### Order constraints

| Field                       | Description                                                         |
| --------------------------- | ------------------------------------------------------------------- |
| **MOQ per variant**         | Minimum quantity for each individual variant. 0 = no minimum        |
| **MOQ per product (total)** | Minimum total quantity across all variants combined. 0 = no minimum |
| **Max qty per variant**     | Maximum quantity allowed per variant. 0 = no limit                  |

### Display & Actions

| Field            | Description                                                                                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **Display mode** | How the drawer trigger appears on the product page (see [Display modes](/orbit-b2b-docs/variant-drawer/display-modes.md)) |
| **Add to cart**  | Enable/disable the Add to Cart button in the drawer footer                                                                |
| **Start order**  | Enable/disable the Start Order button in the drawer footer                                                                |
| **Send inquiry** | Coming soon (Phase 3)                                                                                                     |
| **Chat now**     | Coming soon (Phase 4)                                                                                                     |

At least one action button must be enabled.

### Labels

| Field                    | Description                                                              |
| ------------------------ | ------------------------------------------------------------------------ |
| **Trigger button label** | Text on the button that opens the drawer (e.g. "Select variants")        |
| **Drawer title**         | Title shown in the drawer header (e.g. "Select variations and quantity") |
| **Add to cart label**    | Text on the Add to Cart button                                           |
| **Start order label**    | Text on the Start Order button                                           |

All labels support [per-locale translations](/orbit-b2b-docs/variant-drawer/labels-translations.md).

### Design

Over 25 design tokens to fully customize the drawer appearance. See [Design customization](/orbit-b2b-docs/variant-drawer/design.md) for the full list.

***

## The rule editor

After saving, the rule opens in a full-page editor with three panels:

| Panel             | Description                                                                                                                                                                |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Left sidebar**  | Navigate between settings sections (General, Eligibility, Constraints, Display, Labels, Design). Shows a link to pick a product for the live preview                       |
| **Center canvas** | Live preview of the drawer with real product data from your store. Switch between desktop, tablet, and mobile views. Toggle between locales if you have multiple languages |
| **Right sidebar** | Edit fields for the currently selected section                                                                                                                             |

### Live product preview

The preview uses a real product from your store (defaults to the first product alphabetically). Click the product link in the left sidebar to open the Shopify product picker and select a different product. The preview updates instantly with the selected product's actual variants, prices, and options.

***

## Tips

* Start with a descriptive title like `"B2B Customers — All Products"` so rules are easy to manage.
* Use **Priority** to control which rule applies when a product matches multiple rules. A VIP rule with priority 10 beats a general rule with priority 1.
* Test the drawer appearance on all device sizes using the device picker in the editor before going live.
* To temporarily disable a rule without deleting it, set **Status → Inactive**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://orbit-b2b.gitbook.io/orbit-b2b-docs/variant-drawer/create-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
