> For the complete documentation index, see [llms.txt](https://docs.yaycommerce.com/yaypricing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yaycommerce.com/yaypricing/global-settings/how-the-rules-are-applied.md).

# How the rules are applied

<figure><img src="/files/TJrQv1GqJ28VccUHhp0O" alt=""><figcaption><p>Rule application setting</p></figcaption></figure>

#### All applicable rules

All applicable rules will be applied based on their position in order list (top-down)

*Example:* You have **2 product pricing rules**, and Beanie price is **$20** and **Album price** is **$15**

* Rule 1: Discount $5 when you buy Beanie product.
* Rule 2: Discount 20% when buying from 3 to 4 Beanie

The scenario is:

* When you buy first item which is **Beanie**, you have discount **$5** **( rule 1 is applied )** => Your cart subtotal is **$15**
* When you buy another **Beanie, rule 1** is applied => Your cart subtotal is **$30. $15 x2** of **Beanie**
* When you buy another **Beanie**, **rule 1 and rule 2** are applied => Beanie price now is **$12**. After rule 1, price is **$15,** then **rule 2** affected, price is **$12**. => Subtotal is **$12 \* 3 = $36**

#### **The first applicable rule:**

The first matched rule will take effect, and all other rules following it will be ignored.

#### **Minimum discount amount:**

Rule will make smallest amount of adjustment to take effect.

*Example*: Beanie price is **$20**

* Rule 1: Discount $5 when buying a Beanie
* Rule 2: Discount 10% when buying a Beanie.

\=> Rule 2 will take effect ( The smallest amount of adjustment is **$2** )

#### **Maximum discount amount:**

Rule is the opposite of Minimum discount amount, it will make highest amount of adjustment to take effect.

#### **To non discount product**

Rule will only apply to products that are not on sale or have no discounts applied to them.

*Example:*&#x20;

* Rule 1: Discount 10% when buying a Beanie
* Rule 2: Discount 50% when buying a Cap, Beanie

⇒ Rule 2 will only take effect for Cap.
