> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://regiostech.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Create Discounts Based on Price Rank

A "ranked by price" discount gives each item in the cart a different discount based on where it falls when the items are lined up by price. The most expensive item might get no discount, the 2nd most expensive 20% off, the 3rd most expensive 30% off, and so on. It updates automatically as customers add, remove, or change the quantity of items.

Use it for things like:

* "The 2nd most expensive item gets 20% off, the 3rd gets 30% off, the 4th gets 40% off"
* "The cheapest item is free when you buy 3"
* "The 2nd and 4th most expensive items are 50% off" (buy one, get one 50% off style promotions)
* "30% off the most expensive item, 40% off the 2nd, 50% off the 3rd and beyond"
* "The cheapest item is 40% off and the 2nd cheapest is 25% off"
* "The lowest priced item gets the highest discount"

## How it works

* Items are lined up by price using the discount's **What order to apply discounts to products in** setting. Choose **Discount highest priced products first** or **Discount lowest priced products first**. Ranked discounts do not work with "In the order they appear in the cart", because the app can't see the order items were added.
* Each unit counts as its own item. If a customer buys 3 of the same product, those 3 units take 3 places in the line.
* The price used is the product's price, not the compare at price.
* If two items cost the same, they are lined up in the order they appear in the cart.
* Each row picks its own discount type, so one rank can be "No discount", the next "Percentage off", and another "Fixed price".
* Items after the last row get no discount, unless you turn on **Apply to the rest**.
* Under a [Buy X step](/en/article/how-to-use-buy-x-steps-10mrod/), each set is ranked on its own. For example, "each pair gets 50% off its cheapest item" gives every pair its own cheapest item.

## How to set it up

![The Discount by price rank card in an Apply discount step](https://storage.crisp.chat/users/helpdesk/website/-/d/1/3/e/d13e90de659a8800/ranked-by-price-editor_1kn79mv.png =666x534)

1. Create a product discount and open the logic builder.
2. Add an **Apply discount** step and choose **Ranked by price** as the discount type.
3. In the **Discount by price rank** card, click **Add next item** for each item you want to discount. The rows are labeled to match your sort order: "Most expensive item", "2nd most expensive", and so on (or "Cheapest item", "2nd cheapest" if you rank lowest priced first).
4. For each row, choose a discount type (No discount, Percentage off, Amount off, or Fixed price) and enter a value.
5. If the card shows a warning that ranked discounts need items ordered by price, click **Highest priced first** or **Lowest priced first**.
6. Optional: turn on **Apply to the rest** to give every item after your last row a discount.
7. Save the discount and test it on the **Test discounts** page.

## Example: 0%, 20%, 30%, 40% by price

Sort order: **Discount highest priced products first**

| Item | Discount |
| ---- | ---- |
| Most expensive item | No discount |
| 2nd most expensive | 20% off |
| 3rd most expensive | 30% off |
| 4th most expensive | 40% off |

With items priced $100, $80, $60, and $40, the customer pays $100, $64, $42, and $24.

## Example: cheapest item free at 3 items

Sort order: **Discount lowest priced products first**

| Item | Discount |
| ---- | ---- |
| Cheapest item | 100% off |

Add a condition to the discount so it only applies when the cart has at least 3 eligible items.

## Example: 2nd and 4th most expensive items 50% off

Sort order: **Discount highest priced products first**

| Item | Discount |
| ---- | ---- |
| Most expensive item | No discount |
| 2nd most expensive | 50% off |
| 3rd most expensive | No discount |
| 4th most expensive | 50% off |

## Example: 30%, 40%, then 50% for everything else

Sort order: **Discount highest priced products first**

| Item | Discount |
| ---- | ---- |
| Most expensive item | 30% off |
| 2nd most expensive | 40% off |
| Apply to the rest | 50% off |

## Example: the cheapest item is 40% off and the 2nd cheapest is 25% off

Sort order: **Discount lowest priced products first**

| Item | Discount |
| ---- | ---- |
| Cheapest item | 40% off |
| 2nd cheapest | 25% off |

## What ranked discounts can't do

* They can't discount items based on the order the customer added them to the cart. Ranking by price is the closest option.
* They only work on product discounts. They are not available for order or shipping discounts.
* You can list up to 10 ranks, plus "Apply to the rest".

## Your Feedback Matters
Your review helps keep this small business running. Please [leave one](https://apps.shopify.com/regios-automatic-discounts#modal-show=ReviewListingModal) on the Shopify App Store.