How to customize discount codes for upsells
Overview
When a customer adds a discounted upsell item to their cart, a discount code is displayed on the order summary and confirmation. Customizing this discount message enhances clarity for both you and your customers, ensuring transparency about the applied discounts.
This helps you to understand where a discount originated from and the customer to understand which discount they received.
Customizing Discount Messages
Using Shopify Functions
Access the Discount Message Field:
When creating or editing an upsell offer using Shopify Functions, locate the "Discount message" field.
Enter your desired text to personalize the discount code that will appear to customers.

Using Script Editor
The image below is displaying checkout upsells.

You can Modify the Discount Message in Scripts:
Navigate to Apps in your Shopify Admin panel.
Open the Script Editor app.
Select the live script that applies the line item discount to your upsell.
Search the code for the term 'message'.
Update the text associated with 'message' to your preferred discount message.

Post-Purchase Checkout Offers
Post-purchase offers edit the original order with an additional product. Discounts for these type of offers are common and work well to improve AOV. The discount message will display on the customers order confirmation.
To Set Discount Messages in the app:
Navigate to your post-purchase offer.
Scroll down to find the field labeled 'Discount message to appear on order confirmation'.
Enter your customized discount message.
Click Save to apply the changes.

The custom discount code will show in your order timeline and for the customer in checkout and their confirmation email.

Key Considerations
Consistency: Ensure that the discount message accurately reflects the promotion to avoid customer confusion.
Testing: After customizing discount messages, perform test transactions to verify that the correct message appears during checkout and on order confirmations.
Related Articles
Intro to Discounts
How Do I Apply a Discount to a Checkout Upsell Using Script Editor?
Updated on: 14/02/2025
Thank you!