Showing price after an automatic discount directly on the product page

Topic summary

Core Issue:
Merchants want automatic discounts to display directly on product pages (showing original price crossed out with discounted price), not just in the cart. Currently, Shopify’s automatic discounts only apply and show after items are added to cart, forcing manual price changes or workarounds.

Community Frustration:

  • Multiple users confirm this is a long-standing problem (thread spans 2019-2024)
  • Many view this as a basic e-commerce feature that Shopify should provide natively
  • Some express frustration that Shopify profits from third-party apps instead of fixing core functionality
  • Concern that showing only discounted prices (without strikethrough comparison) reduces conversion effectiveness

Technical Workarounds Attempted:

JavaScript/AJAX Method:

  • Users like Pardoc and Steven_Amrhein developed code that temporarily adds products to cart via Ajax API, retrieves discount data from line_level_discount_allocations, displays it, then removes items
  • Major drawback: Creates false “Add to Cart” events in analytics (Shopify, Facebook, Google Analytics)
  • Requires jQuery and theme code editing; doesn’t work well with product variants or minimum purchase requirements

Manual Liquid Code:

  • NewZealand shared a solution manually calculating discounts in product-price.liquid (e.g., multiplying price by 0.75 for 25% off)
  • Simpler but requires hardcoding discount percentages and doesn’t show properly in Google Shopping

Current Solution (2024):
Developer soulchild37 created “Yagi Automatic Discount Helper” app that uses metafields to display automatic discount prices on product/collection pages without speed impact or analytics issues.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi,

I manually solved this be adding the following codes :

Shopify Automatic Discount : 25% on ALL products except products with product type is NODISCOUNT (or whatever condition you have on your automatic discount)

On Product page: snippets\product-price.liquid

Replace From :

assign compare_at_price = variant.compare_at_price> assign price = variant.price

To:

if product.type == “NODISCOUNT”> assign compare_at_price = variant.compare_at_price> assign price = variant.price> else> assign compare_at_price = variant.price> assign price = variant.price | times: 0.75> endif

The above code will show the automatic percentage discounts on the product page (matching the cart page), However, the only issue here is that the discounted price will not be showing in Google. (Fact: When you set manual discount on product admin , i.e compare price/price fields , Google will show the discounted price ) . Anyone suggests a solution for this google issue?

Regards
NewZealand

Any update on this question.

1 Like

This worked for me for the product page but in the home page in my bestselling products section it still shows without the discounted price. Can you tell me if there is a code for that too?

its 2024… is there an update for this? maybe there is and i just havent found it yet.

1 Like

Yes I am still looking for this too. There may be third party apps that can acheive this, but I guess the next best option is to “bulk edit” every product in that collection to allow for it. What a huge pain!

thanks again Shopify for listening to us… why don’t you ever just listen to your stores? :crying_cat:

If anyone have used this code on debut theme what changes you made?

As when I am using it it’s not working

That’s a work around, but it doesn’t create the same customer experience. Showing the regular price and then the discounted price motivates customers. Just discounting your price, now just becomes your price. You will not get the same results in sales. Shopify should be ashamed of themselves, but that ship sailed when they go rid of phone support.

Its not a bad idea, its just a shame that this is the best we can do with this awful system.

Here in 2024 and wondering the same thing.. Black Friday is coming up and there’s nothing without coding.. this is such a BASIC feature?

Hi @armdgnthr and other merchants,

I have just made an app specifically to show discounted product prices on the product page and collection , the app utilizes metafields and can display discounted price (from the automatic discount you have created on Shopify Admin) on the product page / collection / search result. (Yes it is unfortunate that Shopify does not have this functionality natively)

You can generate the discounted price text with one click in the app (it will follow the discount percentage / amount of the automatic discount).

On product page, you can use the app block to display the discounted price (you can drag and drop it in the theme editor), which does not impact the store speed, as it uses Liquid to output the discounted price. (There’s also instruction in the app for showing discounted price in collection / home page, I would be happy to assist on the setup)

The app name is Yagi Automatic Discount Helper (https://apps.shopify.com/yagi-automatic-discount-helper ), you can view the demo store in the app listing page to see how it works.

soulchild37_0-1744359958553.png

Hope this can help!

Regards,

Axel Kee (developer of the Yagi Automatic Discount Helper app)