# 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="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2FjlYuqd15NcoDB6C5tnNN%2Fimage.png?alt=media&#x26;token=b3460a08-5276-418a-a81b-01e45140cc1d" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2FYlx0A6UAjWByCzSsJsm6%2Fimage.png?alt=media&#x26;token=38c9cb9a-4637-49d6-9ddf-800e9f50f838" 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="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2FTURcRCJIqehQGOsYsuV7%2Fimage.png?alt=media&#x26;token=97609ad2-3da0-4640-ada7-0b47ed5768a8" alt=""><figcaption></figcaption></figure>
