# Calculate Free Shipping Message Function

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2FGoZWaGKCDVvBfVPdEjRr%2Fimage.png?alt=media&#x26;token=bbe0cbe9-f824-4250-a033-455b686dbb5e" alt=""><figcaption></figcaption></figure>

Go to **Storefront** -> **My Themes** -> **Customize**. <mark style="color:red;">(If your store is a new store, you may need to go to</mark> <mark style="color:red;"></mark><mark style="color:red;">**Channel Manager -> Themes -> Edit Theme**</mark><mark style="color:red;">)</mark>

In the **Theme Editor** -> Go to **Other Settings / Calculate Free Shipping**

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2FuFaKfbf3GwaEeUIj2iJ9%2Fimage.png?alt=media&#x26;token=3113c764-7c66-4f9d-8d8b-3188a9bcaada" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
When you are happy with your changes, don't forget click **Save** and **Publish** to repackage the edited theme.
{% endhint %}

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2FetPP1Hj7y5nKjTFF6zDx%2Fimage.png?alt=media&#x26;token=2e50e236-1057-4180-9004-6c5b6a098b1a" alt=""><figcaption></figcaption></figure>

Go to **Marketing** -> **Promotions** -> click button **New automatic promotion**.

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2FVKDTdSzpsBWqpNjhcQzu%2Fimage.png?alt=media&#x26;token=37ace99d-250e-4a8c-b950-4ae7a9cebdd6" alt=""><figcaption></figcaption></figure>

Fill in the content of **Promotion Details** such as this example below (you can change the price, countries,...)

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2F00bgAudSLGMBTde0xdUP%2Fimage.png?alt=media&#x26;token=361478cc-ebc5-46bb-bb5d-4c8151fb57d6" alt=""><figcaption></figcaption></figure>

Fill in the content of **Promotion Options** such as this example below

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2F06l76thuZDuuboyHFBQc%2Fimage.png?alt=media&#x26;token=1cbf2cd5-d3fb-43c1-b7b4-237d8720b96e" alt=""><figcaption></figcaption></figure>

This is sample code:

```html
 <span class="congratulation">Congratulations Banner Message <span class="country">All</span></span>
```

<figure><img src="https://3763408133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAiUiFJqLxmK0ltRywVy%2Fuploads%2FoDrxUEdiDprZx4lSv5fz%2Fimage.png?alt=media&#x26;token=dccedf23-cf24-41b8-ae53-9c9d34ad50a9" alt=""><figcaption></figcaption></figure>

This is sample code:

<pre class="language-html"><code class="lang-html">&#x3C;span>Upsell Banner Message
<strong>    &#x3C;span class="condition_required">%%condition.required%%&#x3C;/span>
</strong>    &#x3C;span class="condition_matched">%%condition.matched%%&#x3C;/span>
    &#x3C;span class="condition_remaining">%%condition.remaining%%&#x3C;/span>
    &#x3C;span class="country">All&#x3C;/span>
&#x3C;/span>
</code></pre>

Code explanation:

```html
<span class="country">All</span>
```

Is the code of country you want to apply discount. Example:

```html
<span class="country"> US,UK,CA </span> is for United State, United Kingdom and Canada
```

```html
<span class="country"> VN </span> for Vietnam.
```

```html
If you want to apply discount for all of countries, you can setup All <span class="country">All</span>
```

{% hint style="info" %}
When you are happy with your changes, don't forget click **Save**.
{% endhint %}
