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

# Conditional Blocks

> Show different content based on product data using if/else logic. React to price, stock, category, country, or season, with the right text per product automatically.

Show the right content for each product, automatically. Conditional blocks work like if/else statements: you set conditions, and WISEPIM picks the matching content per product. Low stock gets an urgency message, a dangerous good gets a safety warning, a premium product gets a warranty line. You write the rules once.

Set them up on the **Conditional** tab in **Settings > [Content Logic](/en/workflows/content-logic)**.

## Build a conditional block

<img className="block dark:hidden" src="https://mintcdn.com/swiftsyncai/ZdmnAJ65bwRiVjL1/images/marketing-screenshots/settings/content-logic-conditional-light-branded.webp?fit=max&auto=format&n=ZdmnAJ65bwRiVjL1&q=85&s=0700883ca05ac437c11efefcc15a6543" alt="WISEPIM content logic, the Conditional tab where dynamic conditional rules are defined" width="2400" height="1445" data-path="images/marketing-screenshots/settings/content-logic-conditional-light-branded.webp" />

<img className="hidden dark:block" src="https://mintcdn.com/swiftsyncai/Q3dIqlj_CJMF6Idi/images/marketing-screenshots/settings/content-logic-conditional-dark-branded.webp?fit=max&auto=format&n=Q3dIqlj_CJMF6Idi&q=85&s=bb241976daa038d45c71f40c67178f82" alt="WISEPIM content logic, the Conditional tab where dynamic conditional rules are defined" width="2400" height="1445" data-path="images/marketing-screenshots/settings/content-logic-conditional-dark-branded.webp" />

<Steps>
  <Step title="Create the block">
    Give it a name and a key.
  </Step>

  <Step title="Define conditions">
    Pick a product field, choose an operator, and enter a value to compare against. Combine multiple conditions with **AND** or **OR**.
  </Step>

  <Step title="Write the content">
    Enter the content for when conditions are met (**then**). Add **else if** branches for other cases, and an optional **else** for the fallback.
  </Step>

  <Step title="Reference in content">
    Use the key to insert the block anywhere variables are supported.
  </Step>
</Steps>

### Condition operators

| Operator                | What it checks              | Needs a value? |
| ----------------------- | --------------------------- | -------------- |
| `equals`                | Exact match                 | Yes            |
| `not_equals`            | Does not equal              | Yes            |
| `contains`              | Contains a substring        | Yes            |
| `not_contains`          | Does not contain            | Yes            |
| `starts_with`           | Starts with                 | Yes            |
| `ends_with`             | Ends with                   | Yes            |
| `greater_than`          | Greater than (numeric)      | Yes            |
| `less_than`             | Less than (numeric)         | Yes            |
| `greater_than_or_equal` | Greater than or equal       | Yes            |
| `less_than_or_equal`    | Less than or equal          | Yes            |
| `in_list`               | Is one of (comma-separated) | Yes            |
| `is_empty`              | Has no value                | No             |
| `is_not_empty`          | Has a value                 | No             |
| `is_true`               | Boolean true                | No             |
| `is_false`              | Boolean false               | No             |

Conditions can reference any product field, custom attribute, or date/time variable.

## Common patterns

Here are ready-to-use blocks for everyday scenarios. Each row is one branch, evaluated top to bottom.

<AccordionGroup>
  <Accordion title="Free shipping banner by price" icon="truck">
    Show a different shipping message based on the product price. **Key:** `free_shipping`

    | Branch | Condition                         | Content                                                                                                     |
    | ------ | --------------------------------- | ----------------------------------------------------------------------------------------------------------- |
    | IF     | `product.price` greater than `50` | Free shipping included.                                                                                     |
    | ELSE   | None                              | Shipping calculated at checkout. Add €`{{global.free_shipping_threshold}}` to your order for free shipping. |
  </Accordion>

  <Accordion title="Stock urgency messaging" icon="boxes">
    Create urgency for low stock and set expectations for out-of-stock items. **Key:** `stock_message`

    | Branch  | Condition                                                                           | Content                                                      |
    | ------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------ |
    | IF      | `product.stock_quantity` less than `5` AND `product.stock_status` equals `in_stock` | Only `{{product.stock_quantity}}` left in stock, order soon. |
    | ELSE IF | `product.stock_status` equals `out_of_stock`                                        | Currently out of stock. `{{global.restock_text}}`            |
    | ELSE IF | `product.stock_status` equals `on_backorder`                                        | Available on backorder. `{{global.backorder_lead_time}}`     |
    | ELSE    | None                                                                                | In stock and ready to ship. `{{global.lead_time_text}}`      |
  </Accordion>

  <Accordion title="Seasonal promotions" icon="snowflake">
    Show different promo content based on the time of year. **Key:** `seasonal_promo`

    | Branch  | Condition                         | Content                                                                    |
    | ------- | --------------------------------- | -------------------------------------------------------------------------- |
    | IF      | `current.season` equals `Winter`  | Winter Sale: save up to 30% on selected items.                             |
    | ELSE IF | `current.season` equals `Summer`  | Summer clearance: extra discounts on last season's stock.                  |
    | ELSE IF | `current.month` equals `November` | Black Friday deals: check `{{global.website_url}}`/blackfriday for offers. |
    | ELSE    | None                              | *(empty, no promo)*                                                        |
  </Accordion>

  <Accordion title="B2B lead time by product type" icon="clock">
    Show the right lead time per product. **Key:** `lead_time`

    | Branch  | Condition                                                  | Content                                                                         |
    | ------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------- |
    | IF      | `product.category` in\_list `Custom Orders, Made to Order` | Lead time: 4-6 weeks. Contact `{{global.support_email}}` for expedited options. |
    | ELSE IF | `product.stock_quantity` greater than `100`                | In stock. Ships within 1-2 business days.                                       |
    | ELSE IF | `product.stock_quantity` greater than `0`                  | In stock. `{{global.lead_time_text}}`                                           |
    | ELSE    | None                                                       | Available on backorder. `{{global.backorder_lead_time}}`                        |
  </Accordion>

  <Accordion title="Hazardous material warnings" icon="triangle-alert">
    Add safety warnings to dangerous goods automatically. **Key:** `hazmat_notice`

    | Branch | Condition                            | Content                                                                                                                                       |
    | ------ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
    | IF     | `product.is_dangerous_good` is\_true | Warning: Hazardous material. Special shipping restrictions apply. `{{brand.hazmat_handling}}` Refer to the Safety Data Sheet before handling. |
    | ELSE   | None                                 | *(empty)*                                                                                                                                     |
  </Accordion>

  <Accordion title="Description suffix by price tier" icon="layers">
    Add different messaging based on the product's price tier. **Key:** `price_tier_text`

    | Branch  | Condition                          | Content                                                                                                                      |
    | ------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
    | IF      | `product.price` greater than `500` | Premium product. Includes `{{brand.warranty_text}}` Contact our specialist team for bulk pricing: `{{global.support_email}}` |
    | ELSE IF | `product.price` greater than `100` | Professional grade. `{{brand.warranty_text}}` Volume discounts available.                                                    |
    | ELSE    | None                               | `{{brand.warranty_text}}`                                                                                                    |
  </Accordion>

  <Accordion title="Compliance text by country of origin" icon="globe">
    Show different compliance statements based on where the product is made. **Key:** `origin_compliance`

    | Branch  | Condition                                                 | Content                                                                             |
    | ------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------- |
    | IF      | `product.country_of_origin` in\_list `CN, TW, VN, TH`     | Imported product. Complies with EU import regulations. `{{global.reach_statement}}` |
    | ELSE IF | `product.country_of_origin` in\_list `DE, NL, FR, IT, ES` | Manufactured in the EU. `{{global.compliance_general}}`                             |
    | ELSE    | None                                                      | `{{global.compliance_general}}`                                                     |
  </Accordion>

  <Accordion title="Content completeness nudge (internal)" icon="circle-alert">
    Flag products with missing data in internal exports or reports. **Key:** `data_quality_note`

    | Branch  | Condition                            | Content                                   |
    | ------- | ------------------------------------ | ----------------------------------------- |
    | IF      | `product.description` is\_empty      | MISSING: Product description not set.     |
    | ELSE IF | `product.meta_description` is\_empty | INCOMPLETE: SEO meta description missing. |
    | ELSE IF | `product.main_image` is\_empty       | INCOMPLETE: Main product image missing.   |
    | ELSE    | None                                 | *(empty, data looks complete)*            |
  </Accordion>

  <Accordion title="MOQ messaging for B2B" icon="package">
    Show minimum order info that varies by product type and stock level. **Key:** `moq_message`

    | Branch  | Condition                                                           | Content                                                                                           |
    | ------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
    | IF      | `product.category` in\_list `Heavy Machinery, Industrial Equipment` | Minimum order: 1 unit. Freight shipping required. Contact `{{global.support_email}}` for a quote. |
    | ELSE IF | `product.stock_quantity` greater than `500`                         | In stock. Order from `{{category.moq}}` units. Volume discounts available for 500+ units.         |
    | ELSE    | None                                                                | Minimum order: `{{category.moq}}` units. `{{global.lead_time_text}}`                              |
  </Accordion>

  <Accordion title="Sale badge content" icon="badge-percent">
    Generate dynamic sale badge text based on the discount depth. **Key:** `sale_badge`

    | Branch  | Condition                                               | Content                                       |
    | ------- | ------------------------------------------------------- | --------------------------------------------- |
    | IF      | `product.savings_percent` greater\_than\_or\_equal `50` | MEGA DEAL: `{{product.savings_percent}}`% OFF |
    | ELSE IF | `product.savings_percent` greater\_than\_or\_equal `25` | SALE: `{{product.savings_percent}}`% OFF      |
    | ELSE IF | `product.special_price` is\_not\_empty                  | `{{product.savings_percent}}`% OFF            |
    | ELSE    | None                                                    | *(empty, not on sale)*                        |
  </Accordion>
</AccordionGroup>

## Tips

* Branches are evaluated top to bottom, and the first match wins. Put specific conditions above general ones.
* Use **AND** when all conditions must be true (low stock AND in stock). Use **OR** when any one should trigger the content.
* Content fields support all variables: `{{product.*}}`, `{{global.*}}`, `{{brand.*}}`, and `{{category.*}}`.
* Leave the **else** content empty when you want no output for non-matching products.

## Related

<CardGroup cols={2}>
  <Card title="Default Variables" icon="database" href="/en/workflows/content-logic/default-variables">
    The built-in `{{product.*}}` and `{{current.*}}` fields you test against.
  </Card>

  <Card title="Global Variables" icon="globe" href="/en/workflows/content-logic/global-variables">
    Reusable values to drop into your branch content.
  </Card>

  <Card title="Brand Variables" icon="tag" href="/en/workflows/content-logic/brand-variables">
    Brand-specific content to show inside conditions.
  </Card>

  <Card title="Category Variables" icon="folder-tree" href="/en/workflows/content-logic/category-variables">
    Category-specific content to show inside conditions.
  </Card>
</CardGroup>
