# Category discount

When it comes to category discounts, we may have these scenarios:

* If a customer adds $100 worth of **Accessories** category, their **whole cart** gets 5% off.
* If a customer adds $100 worth of **Accessories** category, their **subtotal cart value** of those products gets 5% off.
* If a customer adds $100 worth of **Accessories** category, they get a **free item** or another discounted product.

### Min spend on categories gets free item

Here's how to set up this promotion: **Spend $100, get 1 gift,** i.e. "If the customer spends a certain amount on specific categories, they automatically get a free item".

#### Step 1: Specify categories and gift item

Let's get started to offer a free t-shirt if an order contains products from the categories A, B, C, or D.

* Buy products: customers should buy products from these categories A, B, C, D.
* Get products: customers get a giveaway as a t-shirt.

<figure><img src="/files/yW6SCPfZxtvtKQQDEkRX" alt="Category products and giveaway product"><figcaption></figcaption></figure>

#### Step 2: Set the required minimum spend&#x20;

Go to **Conditions** tab and add your requirement. E.g. the monetary amount of those cart items from the categories A, B, C, or D is greater than or equal to $100.

<figure><img src="/files/6vyREdaE3e4LksRJjq1D" alt="Minimum spend on these categories gets free item"><figcaption></figcaption></figure>

#### Step 3: Set up other additional settings and save changes.

On cart page, when the cart subtotal of those items from A, B, C, or D categories reaches $100, the t-shirt will be automatically added for free.

<figure><img src="/files/KhaOHzVJAvIoL8uAIhcf" alt="WooCommerce dynamic discount on cart page"><figcaption></figcaption></figure>


---

# 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.yaycommerce.com/yaypricing/use-cases/category-discount.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.
