Overview
The Discount Code block helps you display a coupon code and make it easy for customers to copy it.
You can show the code, a copy button, a copy icon, or different combinations depending on your layout.
Where to use this block
You can add the Discount Code block anywhere theme blocks are supported, for example:
Announcement/promo sections
Media Banner, Media with text, and Custom sections
FAQ/help content
Any marketing or conversion-focused section
How to add this block
Open the Theme Editor
Navigate to a section that supports blocks
Click Add block
Select Discount code
Block settings
Content
Layout
Controls how the code, button, and icon are displayed:Code before button
Code after button
Code above button
Only code
Only button
Only code and copy icon
Only button and copy icon
Code
The discount code text (example:SALE50).Button label (visible when the selected layout includes a button)
Text shown on the copy button (example: Copy code).Message (copied successfully) (visible when Layout is not “Only code”)
Message shown after the code is copied (example: Copied!).
Typography & sizing
Font size scale (50%–150%)
Scales the text size for the code/button area.Button size (visible when the selected layout includes a button)
Extra small / Small / Medium / Large (mapped to your theme’s button sizing)Icon size (visible when the selected layout includes a copy icon)
16 / 18 / 20
Code appearance (visible when the selected layout includes a code)
Custom background
Enables a custom background behind the code.Background color (visible when Custom background is enabled)
Supports transparency (alpha).Borders
None / Solid / DashedBorder width (visible when Borders is not None)
Controls border thickness.Border opacity (visible when Borders is not None)
Controls border transparency.Border radius
Rounds the code container corners.
Tips
Use Code before button or Code above button for the clearest “copy” experience
Keep codes short and easy to read (e.g.,
SAVE10,FREESHIP)If you use a busy background, enable Custom background to improve readability
Use the copy message (e.g., Copied!) to reassure customers the action worked
Limitations
Some settings are only shown depending on your selected Layout:
Button settings appear only when the layout includes a button
Icon settings appear only when the layout includes an icon
Code appearance settings appear only when the layout includes a code
Common use cases
Limited-time promotions on the homepage
Seasonal campaigns (Black Friday, New Year, etc.)
Free shipping or first-order coupon messaging
Email/social promo landing sections (show code + copy CTA)
Need help?
If the copy action doesn’t work as expected, try switching layouts and test in the live preview. Also confirm the displayed code matches an active discount code configured in Shopify admin.
Note: This block only copies the code to the clipboard. Customers still need to apply the code at checkout (or in the cart, depending on Shopify setup).
Comments
0 comments
Please sign in to leave a comment.