> For the complete documentation index, see [llms.txt](https://docs.condicart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.condicart.com/core-features/creating-rules.md).

# Creating Rules

Learn how to create and manage conditional rules for your Add to Cart button

### 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:

* **Disable** - 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)
