# Unified Discount Engine (v2)

Discount engine (v2) is a huge improvement over our initial (v1) implementation, bringing in support for&#x20;

1. Cart groups&#x20;
2. Nested conditional logics
3. Derived variables from cart groups
4. Target cart groups
5. Quantity based discount limit&#x20;
6. Disbursing fixed amount across eligable line items
7. Custom discount presentation

Here's a quick and easy way to visualise how the new engine works, with the logic explained as simple flow charts

<figure><img src="/files/gnBMPjZe2H3C6cla7pbQ" alt=""><figcaption></figcaption></figure>

Here's also an example configuration for better understanding of the concept.

<figure><img src="/files/oMS7YcjCTHu0Yn1iL6ka" alt=""><figcaption></figcaption></figure>

***

{% hint style="info" %}
Discount engine v2 is currently stable and will be available on all plans.
{% endhint %}

{% hint style="success" %}
You can also set up a single function to do more than just a single discount type by choosing the necessary discount classes in the function.
{% endhint %}

<figure><img src="/files/7znffF0Qtq5FnIgImfwM" 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/unified-discount-engine-v2.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.
