Is it possible to make a customized pop up message or label appear when a customer uses a specific discount code.
I am trying to tie a discount code to a donation pledge (each time someone uses a certain discount code, we commit to making a donation to a specific org.)
I would like a message to appear that states “thanks for supporting X organization” when a certain discount code is applied.
Thank you !
Hi
Yes It’s possible and you can do it by adding some code and editing the theme in website.
Let me know if you want more details .
I am interested in learning more
Hi @alaskasalmon , I’m assuming you’re not on Shopify plus and need to show this when the discount code is applied on cart.
Here’s a script that you can include on your theme.liquid before the tag,
You can customise this array near the end to ensure that the script check for the exact discount code you’ve configured and show a message based on the same.
discountConfigs: [
{
code: 'TEST10',
organizationName: 'X organization',
message: 'Thank you for using the TEST10 code! 10% of your purchase supports X organization.'
},
{
code: 'CHARITY20',
organizationName: 'Charity Foundation',
message: 'Thank you for your generosity! 20% of your purchase will be donated to Charity Foundation.'
},
{
code: 'EARTH5',
organizationName: 'Earth Alliance',
message: 'Thank you for supporting environmental causes! Your EARTH5 discount helps plant 5 trees.'
}
]
Note that this is not a theme specific implementation, meaning that it should work with any theme and any Shopify store.
If you found this helpful - please mark my answer as a solution so others can also find value from this.
Thank you,
Hi Alaska Salmon,
If you tried the code given by abel and solution rectified then that’s great if not , let me know .
Hello Alaskasalmon,
Typically, customers enter discount codes in the checkout - an area where only Shopify Plus customers can change the UI/UX.
If you are on Shopify Plus, then you can consider developing a custom app using the Checkout UI Extensions API:
You might be able to build this with Checkout Blocks, an app owned by Shopify.
Best,
Tobe
@alaskasalmon
Since quite some time has passed since you raised this thread, I’m assuming you’ve already reached at a solution 
If so - can you please share the same and close this thread out so that others who stumble here might also find value.
Best,