# Shipping discount

You can build shipping discount campaigns for your customers, like free shipping over a holiday period or 50% off shipping when ordering two or more items. Function Junction applies shipping discounts right into the checkout.

## In this section

* [Shipping discount example](#shipping-discount-example)
* [Setting up a shipping discount](#setting-up-a-shipping-discount)

***

## Shipping discount example

In this example, the customer can qualify for free shipping if their cart subtotal is over $100 or if they have five or more items in the cart.

#### The result:

At checkout, the customer will see their shipping discount and custom message.

### The function triggers

In this example, there are two trigger conditions. The **OR** statement is used in this case to allow either of the two conditions to apply the discount.&#x20;

When the cart has conditions that qualify, the discount is applied.

<figure><img src="/files/4shrhFwvT4juFKff82Pr" alt=""><figcaption><p>Any of the two trigger conditions will execute the action</p></figcaption></figure>

## Setting up a shipping discount

### Step 1 of 4: Campaign name

1. From the Function Junction dashboard, under **Quick start templates**, click **Shipping Discount**.
2. Under **Function name**, give your discount a unique name so you can identify it later.

{% hint style="info" %}
**Note:**

Function names (also called campaign names) need to be unique. Once created, they appear in the **Discounts** section of the Shopify admin.
{% endhint %}

### Step 2 of 4: Function trigger

In this example, there are two triggers. The **OR** statement is required, meaning that one condition or the other must be met to trigger the discount. For the trigger conditions, the customer needs to have a cart subtotal of over $100 or have five or more items in the cart.

1. Set up the conditions that customers need to meet to get the discount. In this example, the function needs one of two conditions, so click **Add a condition** and then enter the following conditions:&#x20;
   1. `If` `cart subtotal` `is greater than or equal to` `100`
   2. `or` `cart items quantity` `is greater than` `5`
2. Click **Next**.

### Step 3 of 4: Function action

1. Set up the action (the discount) that is taken when the conditions you set are met.
   1. For this example, the action should be: **Percentage total discount.**
   2. Fill in the second text box with the number representing the discount amount you want to set up, then click **Next.** In this example, the discount is **`100`**%.
2. Optional: Under **Filter**, add a filter. You can choose to set the discount for only specific products. This can be based on: **product/variant, product tag, collection, vendor, type,** or **on sale**. Each filter condition you can choose has specific rules that you need to set up.&#x20;
3. When you're done, click **Next**.

In this example, the customer is rewarded with 100% off the cost of shipping.

### Step 4 of 4: Discount details

1. Under **Discount type**, select if you want the discount to be **Automatic** or **With Discount Code**. In this example, the discount applies automatically.
   1. **Automatic**: Under **Discount message**, if you select **Yes**, then enter the discount message in the field provided below.
   2. **With Discount Code**: Enter the discount code that you want customers to enter at checkout.
2. Under **Combinations**, if you want this discount to be combined with other discounts, then click **Yes**, and check which types of discounts that you want it to be combinable with.&#x20;
3. When you're done, click **Publish**.

When your discount is published, if you want to advertise it, then you can [publish a widget to your store](/creating-and-publishing.md#step-2-publishing-a-widget-to-your-storefront).


---

# 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://support.functionjunctionapp.com/templates/shipping-discount.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.
