---
title: Loyalty discount based on order history
description: Reward returning WooCommerce customers by orders placed, amount spent or products bought before, with Pricepep order history conditions and tiers.
url: "https://pricepep.com/docs/loyalty-discount-by-order-history/"
updated: "2026-12-02"
category: Examples
---

# Loyalty discount based on order history

To reward loyal customers, add an order history condition to a rule: **Order count** at least 5, **Spent - Total** at least 500, or **Purchased - Products** for customers who bought something before. Pricepep checks the customer's paid orders each time the cart is calculated.

## How do I give 5% off after 5 orders?

1. Go to **WooCommerce > Pricepep > Cart Discounts** and click **Add Rule**.
2. **Title - Public**: "Loyalty discount".
3. **Discount**: **Percentage discount** `5`.
4. **Conditions**: click **Add Condition**, choose **Order count**, timeframe **all time**, **at least**, `5`.
5. Click **Save Changes**.

The customer's sixth order gets 5% off: a $120 cart saves $6.

## How do I make loyalty tiers?

| Rule (top to bottom) | Discount | Condition |
| --- | --- | --- |
| Gold | Percentage discount 10 | **Spent - Total**, 12 months, at least 1000 |
| Silver | Percentage discount 5 | **Spent - Total**, 12 months, at least 300 |

Keep the default **Rule selection method** **Apply first applicable rule** with Gold on top, or choose **Apply bigger discount**, so a Gold customer gets 10%, not both. Both settings cover every cart discount on the tab; if other cart discounts should still combine (**Apply all applicable rules**), add **Spent - Total**, 12 months, **less than** 1000 to Silver instead, so the tiers don't overlap.

## How do I reward the next order?

Example: 10% off the next order after an order of $100 or more, valid for 2 months.

1. Go to **WooCommerce > Pricepep > Cart Discounts** and click **Add Rule**.
2. **Title - Public**: "Thank-you discount".
3. **Discount**: **Percentage discount** `10`.
4. **Conditions**: click **Add Condition**, choose **Spent - Last order**, **at least**, `100`. Add a second condition: **Last order**, **within past**, 2 months.
5. Click **Save Changes**.

**Spent - Last order** checks the total of the customer's last paid order. Once the discounted order is paid, it becomes the last order, so the reward is used once, unless that order is $100 or more too. **Last order** has no 60-day period; for "within 60 days", use 2 months. Pricepep doesn't keep a store credit balance.

## Which history conditions are there?

| Condition | Example |
| --- | --- |
| **Order count** | At least 5 orders, all time |
| **Spent - Total** | Spent at least 500 in 12 months |
| **Spent - Average per order** | Average order at least 80 |
| **Spent - Last order** | Last order at least 100 |
| **Last order** | **earlier than** 6 months, for ["come back" offers](/docs/can-i-discount-customers-who-havent-ordered-in-a-while/) |
| **Purchased - Products** (also Variations, Categories, Attributes, Tags) | Bought product X before |
| **Quantity purchased - Products** (and others) | Bought at least 10 of X |
| **Value purchased - Products** (and others) | Spent at least 200 on category Y |
| **Customer review count** | Wrote at least 1 review |

The full list is in [conditions](/docs/conditions-overview/).

## How are customers and orders matched?

- **Paid orders only.** WooCommerce's paid statuses count: Processing and Completed by default. A custom order status counts only if it's added to them (developers: `woocommerce_order_is_paid_statuses`).
- **Logged-in customers:** their orders, plus guest orders with their billing email.
- **Guests:** by the billing email they enter at checkout, in the classic checkout and in the Checkout block. Before that a guest has no history for Pricepep, so loyalty discounts show up for guests only at checkout.

## Variations

- **Lower prices instead of a cart line:** put the condition on a product pricing rule.
- **Repeat purchase discount:** **Simple adjustment** 10% on **Product** X with **Purchased - Products** X; more in [discounts for past buyers](/docs/can-i-discount-customers-who-bought-a-product-before/).
- **First order instead:** see [first order discount](/docs/first-order-discount/).

## Frequently asked questions

### Which orders count?

Paid orders only: WooCommerce's paid statuses, Processing and Completed by default.

### Can I count only the last 12 months?

Yes. Order count, Spent - Total and the Purchased conditions have a timeframe, for example 12 months.

### Can I reward a customer's next order?

Yes. Add Spent - Last order at least 100 and Last order within past 2 months to a cart discount. Once the discounted order is paid it becomes the last order, so the reward is used once unless that order qualifies too.

## Related articles

- [First order discount for new customers](https://pricepep.com/docs/first-order-discount/)
- [How multiple pricing rules combine in Pricepep](https://pricepep.com/docs/how-pricing-rules-combine/)
- [Discount when the cart is over an amount](https://pricepep.com/docs/cart-discount-over-amount/)
- [Conditions in Pricepep: how they work and combine](https://pricepep.com/docs/conditions-overview/)

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