# Discount Application Strategy

## Understanding discount application strategy

The discount application strategy determines which discount should apply to the items in the cart if more than one discount is applicable to the item(s) in the cart.

***

### Video walkthrough with examples for discount application strategy

{% embed url="<https://drive.google.com/file/d/1czNjApZcToty10DVLeEVzlxm9bk9QdSS/view?usp=sharing>" %}

***

### **Types of Discount Application Strategies:**

<table><thead><tr><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>First</code></td><td>Only apply the first discount with conditions that are satisfied. <br>E.g. If three discounts are eligible, only the first one in the list will be applied.</td></tr><tr><td><code>All</code></td><td>Apply all discounts with conditions that are satisfied. This does not override discount combination or stacking rules.<br><br>E.g. If three discounts are eligible, all three will be applied to the cart.</td></tr><tr><td><code>Maximum</code></td><td>Only apply the discount that offers the maximum reduction.<br><br>E.g. If three discounts are eligible, the one that gives the highest savings will be applied.</td></tr></tbody></table>

{% hint style="info" %}
Discount application strategy is only applicable if your function has more than one discount that evaluates to `TRUE` for a line item / cart.
{% endhint %}

{% hint style="info" %}
If multiple product discounts in the rule builder evaluate to true for a single line item, only the first discount is applied, regardless of the discount application strategy. This means even if you set the strategy to "All," only one product discount can be applied per line item.
{% endhint %}

### **Why This Matters:**

* **First Strategy:** Use this if you want to ensure the order of discount is always applied in ascending order based on how you have set it up in the rule builder.
* **All Strategy:** Use this if you want to allow multiple discounts to apply to the items in user's cart.
  * If the line is eligible for more than one of the discounts configured then the first discount is applied by Shopify, in this case
* **Maximum Strategy:** Use this if you want to give the customer the highest possible discount when multiple discounts are available.

<figure><img src="/files/t3VV9Awrf8OFQadJ258I" alt=""><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://help.dollarlabs.io/dollarlabs-ultimate-discounts/discount-engine-v1/rules-on-function-level/discount-application-strategy.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.
