---
title: Cart discount for one category (or excluding one)
description: Discount one WooCommerce category in the cart, exclude a category from a cart discount, or discount category B when A is in the cart, with Pricepep.
url: "https://pricepep.com/docs/category-discount-in-cart/"
updated: "2026-12-02"
category: Examples
---

# Cart discount for one category (or excluding one)

To discount one category in the cart, create a cart discount with **Percentage discount per cart item** and put the category under **Items**. Only items from that category are discounted, and the discount shows as one line in the cart totals.

## How do I discount one category?

Example: 20% off shoes, shown as "Shoe sale" in the totals.

1. Go to **WooCommerce > Pricepep > Cart Discounts** and click **Add Rule**.
2. Type a **Title - Public**: "Shoe sale".
3. Under **Discount**, choose **Percentage discount per cart item** and type `20`.
4. Under **Items**, click **Add Product**, choose **Product category**, **in list**, Shoes. [Subcategories are included](/docs/does-a-category-discount-include-subcategories/).
5. Click **Save Changes**.

| Cart | Discount |
| --- | --- |
| Sneakers $100 + socks $10 | $20 (20% of $100) |
| Socks only | none: no matching item |

## How do I exclude a category from a cart discount?

Use the same method with **Items** set to **Product category** **not in list** Gift cards. With "10% off everything except gift cards", a cart with a $50 gift card and $100 of other products gets $10 off. To leave sale items out, set **Items** to **Product is on sale** **no**.

To keep products out of all product pricing rules instead, use [Exclude products from all rules](/docs/exclude-products-from-all-rules/); it doesn't affect cart discounts.

## How do I discount category B when category A is in the cart?

Example: 30% off cases when a phone is in the cart.

1. Create a cart discount with **Title - Public** "Case deal" and **Percentage discount per cart item** `30`.
2. **Items**: **Product category** in list Cases (what gets the discount).
3. **Conditions**: **Cart items - Categories**, **at least one of selected**, Phones (what must be in the cart).
4. Click **Save Changes**.

A cart with a $600 phone and a $30 case gets $9 off. To discount one case per phone, use a [Buy x get y](/docs/buy-x-get-y/) product pricing rule instead.

## Why is the whole cart discounted?

**Fixed discount** and **Percentage discount** are calculated on the whole cart and have no **Items**; a condition such as **Cart items - Categories** only decides whether they apply. Choose a **per cart item** or **per cart line** method to discount matching items only. One fixed amount for the matching items together isn't possible; what comes closest is in [discount only some items](/docs/cart-discounts/#how-do-i-discount-only-some-items).

## Cart discount or product pricing rule?

|  | Cart discount | Product pricing rule |
| --- | --- | --- |
| Shows as | A line in the totals with your title | Lower item prices |
| Shop and product pages | Normal prices | Discounted prices, if display is turned on |
| Coupon settings | **Allow coupons with cart discounts** | **Allow coupons when prices are changed** |

For lower prices, use a **Simple adjustment** rule with the category under **Products**; see [product pricing](/docs/product-pricing/).

## Frequently asked questions

### Why does my category cart discount reduce the whole cart?

Fixed discount and Percentage discount have no Items and are calculated on the whole cart; a category condition only decides whether they apply. Use Percentage discount per cart item with the category under Items to discount just the matching items.

### Should I use a product pricing rule or a cart discount?

A product pricing rule lowers the product prices; a cart discount keeps prices and shows a discount line in the totals. Both can target a category.

## Related articles

- [Cart discounts: automatic discounts in the WooCommerce cart](https://pricepep.com/docs/cart-discounts/)
- [Exclude products from all pricing rules](https://pricepep.com/docs/exclude-products-from-all-rules/)
- [Discount when the cart is over an amount](https://pricepep.com/docs/cart-discount-over-amount/)
- [Product pricing rules in WooCommerce: how they work](https://pricepep.com/docs/product-pricing/)

All articles in [Examples](https://pricepep.com/docs-category/examples/)
