Skip to main content

Quick Start: Best Discount Badge

The simplest way to show a discount badge using the max_reward_percent or max_reward_cents scalar metafields.
Product card with red '20% OFF' badge in top-right corner
This approach is simpler than parsing the full discounts array and automatically shows the best available discount.

Best Discount with Title

Show both the discount value and title using max_reward_discount:

Sales Badges

Simple Percentage Badge

Product card with red '20% OFF' badge in top-right corner

Pricing Display

Crossed-Out Original Price

Product pricing showing original price crossed out in gray and sale price in red

Volume Pricing Table

Product with info icon next to title and volume pricing popup showing quantity tiers and discounted prices

Discount Codes

Discount Kit Live surfaces both automatic discounts (applied at checkout when conditions are met) and code-based discounts (the shopper enters a code). The method and code fields let you render the right UI for each.

Render a Code Chip with Copy-to-Clipboard

For code-based discounts, show the code with a copy button instead of an “applied automatically” badge.
Use <button> rather than rendering the code as plain text so it’s keyboard-accessible. Set data-discount-code from Liquid so the copy handler reads the raw value (not the visible label, which you may want to obfuscate or shorten).

Hide a Code If It’s Already Applied

Once a shopper has the code in their cart, the chip is just noise. Check cart.discount_applications to detect already-applied codes and hide the chip accordingly. cart.discount_applications is a Shopify-native array of every discount currently affecting the cart. Each entry has a title (for automatics) or a code (for DiscountCodeApplication entries). For code discounts you compare against application.code.
The , wrappers around each code prevent partial matches: e.g. SALE shouldn’t match SUMMERSALE10. The comparison is downcased on both sides because Shopify treats discount codes case-insensitively at checkout.

Mix: Auto-Applied vs Code-Entry Badge

Render different UI depending on how the discount is redeemed:

Collection Banners

Simple Collection Promo

Collection page with red banner displaying 'PLANTS DISCOUNT Save up to 20% on this collection!'

Next Steps

Data reference

Complete field documentation

Introduction

Learn about Discount Kit Live