> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.devit.software/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).

# Functions - Discount

# ${color}[#204a87](Discount Function)

${color}[#3465a4](In this article:)
* [About Discount Function](#1-about-discount-function)
* [Use templates](#1-use-templates)
* [Create from scratch](#1-create-from-scratch)
* [Need help?](#1-need-help)

# ✔️ About Discount Function

A [__Discount Function__](https://shopify.dev/docs/apps/build/discounts/build-discount-function?extension=rust) is a custom discount created using Shopify Functions that can be applied to different parts of the checkout process, including cart line items, the order subtotal, or shipping rates.

# ✔️ Use templates

Before you start creating workflows, we recommend you to check the list of available Discount Functions. Maybe you will find the most suitable template and be able to add the function without unnecessary settings.

1. Open the app and go to the **Function** tab in the left-side menu.
2. Find the **Discount** block and click **Create**.
3. Click on **Create from template**.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/functions-template_tbdojq.png)

Select the template that you need. Check settings, apply changes if needed, and click **Save** in the upper-right corner.

Now, in the upper-right corner, you can see the **Turn on** button. Click on it to test the workflow.

# ✔️ Create from scratch

**Example:** Offer a discount if the total amount of lines in the cart is greater than 100.

1. Open the app and go to the **Function** tab in the left-side menu.
2. Find the **Discount** block and click **Create** -> **Create from scratch**.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/functions-from-scratch_18go5p0.png)

3. Select the **Cart line discount** in the right-side menu. Here you can set the start date and time, End date and time, and combinations by selecting additional options.
4. Click on the + icon and select **Conditions**.
5. Click on the field **Select conditions** -> Cart -> Lines -> Cost -> Total amount -> Amount.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/total-amount-function_1jutvv8.png)

6. In the **Select matcher** field select **“greater than”** and set the amount you need.
7. Click on + and select **Action**. Click on **Order discount** and set the discount value.
8. **Save** your workflow by clicking the button on the upper-right corner.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/order-discount-action_18nio0m.png)

Now, in the upper-right corner you can see the **Turn on** button. Click on it to test the workflow.

# ✔️ Need help?

Don’t worry if this feels technical - our support team can guide you through the process or even set up the webhook for you. Just send us a message: [__support@devit.software__](http://support@devit.software) 
