# Creating Rules

### Creating Your First Rule

{% stepper %}
{% step %}
**Navigate to Rules Page**

Go to **WooCommerce → Conditional Add to Cart** in your WordPress admin
{% endstep %}

{% step %}
**Click "Add New Rule"**

Click the button to create a new rule
{% endstep %}

{% step %}
**Name Your Rule**

Give your rule a descriptive name (e.g., "Hide Add to Cart for Guests")
{% endstep %}

{% step %}
**Add Conditions**

Click "Add Condition" and select when the rule should activate. You can add multiple conditions that must all be true (AND logic).

For OR logic, click "Add Condition Group" to create an alternative set of conditions.
{% endstep %}

{% step %}
**Set "Which products should be affected?"**

Choose which products this rule affects:

* **All Products** - Rule applies to every product
* **Specific Products** - Select individual products
* **Product Categories** - Select categories
* **All Except Products (Pro)** - Exclude specific products
  {% endstep %}

{% step %}
**Choose Action**

Select what happens when conditions match:

* **Hide** - Remove the button completely
* **Customize** - Change button text, color, or redirect&#x20;
* **Replace** - Show custom HTML instead
* **Quote (Pro)** - Show quote request form
  {% endstep %}

{% step %}
**Save Your Rule**

Click "Save All Rules" at the bottom of the page
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**Rule Created!**

Your rule is now active. Visit your product pages to see it in action.
{% endhint %}

### Managing Rules

#### Rule Priority

Rules are evaluated from top to bottom. The first rule that matches will be applied. Drag and drop rules to reorder them.

#### Enable/Disable Rules

Toggle rules on or off without deleting them. Useful for testing or seasonal rules.

#### Editing Rules

Click on any rule to expand and edit its settings. Changes are saved when you click "Save All Rules".

#### Deleting Rules

Click the trash icon to delete a rule. This action cannot be undone.

{% hint style="info" %}
**Pro Tip**

Create specific rules first, then general rules. Since rules are evaluated top-to-bottom, specific rules will take priority.
{% endhint %}

### Variable Products

The plugin fully supports variable products. You can:

* Apply rules to the parent variable product (affects all variations)
* Apply rules to specific variations only
* Use variation-specific conditions (like price or stock status)


---

# 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://docs.condicart.com/core-features/creating-rules.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.
