Showing applicable discount codes on product page

Shopify Partner
6 0 4



I am working on building a theme for my client. The store has lots of discount codes across different products which are applicable to all the customers unconditionally. The requirement here is to show the discount codes applicable for a specific product on the product page, or atleast in a seperate offers page. 

Is there any way to get the applicable discount codes for a products within the theme?



Replies 48 (48)
Shopify Partner
31 0 5

Thanks Nick, 

Hopefully with the deployment of 2.0 we will see increased focus on value add for consumers. 



New Member
1 0 2

I cant believe that there is no app for this simple yet very powerful feature. On Shopify app store , there are literally thousands of apps for similar kind of features, yet there is no app for this kind of function . Below is another non Shopify store with this feature , Its in another language but , you can understand the feature. It shows how much the final price will be at the checkout (green price) .It says %25 off for purchases over $300. and since the product qualify for the discount , it shows the price in green.


This feature make customer feel like they score a nice additional discount and encourage them to complete the purchase. Of course you can directly apply the discount but it wouldn't give the excitement of scoring a deal.

Screen Shot 2021-10-10 at 21.25.57.png

New Member
1 0 0

I dont find this on the product page to delet!?PHOTO-2021-11-12-19-17-18.jpg

7 0 6

We may need to show one discount for a one-time use coupon and another discount for a coupon associated with an advertisement. Maybe we're running a different sale. These should all be able to be used at the same time by different visitors, so the announcement bar isn't solving this as far as I can tell.

New Member
3 0 0

Do you have the code for this?


4 0 1

I've spent several days searching for something to do this as well but still no updates?

A few people have mentioned they don't want to pay for a plugin to achieve this - I've struggled to even find a paid plugin that does it? Can someone please list them?


The suggested product from "Bold" does not achieve this - it simply discounts a product without any coupons.


I have tinkered with the suggestion from @Ehorvat but unfortunately this is really limited. For example if you have AfterPay running, it won't calculate the correct repayments. There's only so many areas of the website I want to hack into to get this to work.


I can't believe Shopify still haven't added a checkbox for this.

New Member
1 0 0

Hello - 


It's been four years and we have yet to find a solution. Someone come up with this so its already made in Shopify or on an app. 😞 Something so simple yet so complicated to have.


Screen Shot 2022-08-20 at 3.07.03 PM.png

22 0 5

Its crazy it isn't a feature yet 😞

Shopify Staff
Shopify Staff
690 19 268

Hey folks! I think I may have a workaround for this request 🙂


It would be possible to display each individual discount code on the product page by using metafields. The general process would be to assign the discount code as a metafield value to each individual product, and then use the metafield Liquid object to output the unique value/ discount code on each product page. 


If you use this approach however, it’s important to remember that if a product’s discount code is changed, you’d need to manually update the discount metafield on the product level. 


Here’s a description of the process:


  1. Create a discount code for a specific product. 



  1. Create a product metafield definition, with a single line text content type eg: “discount” 06-03-usbk2-hxsbn


  1. On the product editing page that is associated with the discount, add the discount code to the new “discount” metafield: 06-07-saymu-s1b78


  1. If your theme supports sections on all pages, and has a custom Liquid block on your main product section (like Dawn) you can navigate to the Theme Editor and select a Product page. Add a new Custom Liquid block to the main product section, and add code that will display the value of a products' discount metafield (if one exists): 
{% if != blank %}

  <p>Use this discount for 30% off: {{ }}</p>

{% endif %} 




  1. If your theme does not have a custom Liquid block, you can add the same code to a product.liquid template or section to display the message and discount code.


  1. Create more discounts for other products, and add the discount code as the value for the discount (meta)field in the product editing page on the admin. When a buyer switches pages, they’ll see a different discount code (or no code if the product does not contain a discount metafield value). 


Hope this solution helps! You could also customize the look and feel with CSS, and potentially build this as its own block element. It would also be a great idea for an app developer to build this logic and workflow into an app!!



Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog