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

# How to remove discounts on upsells when the conditions for the upsell offer are no longer met with Functions


### Overview

When offering upsell products with conditional discounts, it's crucial to ensure that these discounts are only applied when specific cart conditions are met. If a customer modifies their cart in a way that no longer satisfies these conditions, the discount should be removed. This can be achieved by enabling a setting on your Functions discounts inside your offers.

### Step-by-Step Guide

**1) Log in to Shopify Admin **

**2) Open the UpsellPlus app**
* Navigate to the offer you want to set up a discount for
* Inside the offer, click on the upsell product you want to add a discount for
* Expand the product card, scroll down to 'Discount'

**3) Make sure you're on the Functions discount and not Scripts**
* You can switch between the two at the top right of the Discount card

**4) Select the conditional discount option**
* Select the 'Remove discount when smart rule conditions are no longer met' checkbox. This will automatically remove the discount when the smart rules are no longer met:

| Note: this works for the following smart rules: cart total, cart products, cart product tag, cart product collections, customer tag, customer language, and customer market. We're working on adding more.

![](https://storage.crisp.chat/users/helpdesk/website/abfa0cd47f75e80/screenshot-2025-03-12-at-11065_1wzi2g2.png)
**Key Considerations  **
* Testing: Always perform thorough testing to confirm that discounts are applied and removed correctly based on the specified conditions.
* Shopify has a limit of 25 Functions discount for apps. If you have a need for more discounted offers, reach out to us in the app chat

**Related Articles  **
[How to Block Manual Discount Codes from Being Added on Top of an Automatic Script Discount Using Script Editor](https://help.upsellplus.com/en/article/how-to-block-manual-discount-codes-from-being-added-on-top-of-an-automatic-script-discount-using-script-editor-wmekyk/) 
[How to remove discounts on upsell products when the conditions for the upsell offer are no longer met with Script Editor](https://help.upsellplus.com/en/article/how-to-remove-discounts-on-upsell-products-when-the-conditions-for-the-upsell-offer-are-no-longer-met-with-script-editor-15w0ru0/)
[Intro to Discounts](https://help.upsellplus.com/en/article/intro-to-discounts-yguu96/)