Show % Percentage In Sale Badge - Minimal theme

Topic summary

Goal: Replace the “Sale” badge in Shopify’s Minimal theme with a dynamic discount percentage (e.g., 10%).

What was tried: Editing code in Snippets > product-grid-item.liquid by replacing the translation string with a Liquid formula using compare_at_price_max and price to compute % OFF.

Issue encountered: The provided formula renders “0% OFF” for all products. A screenshot was shared to illustrate the problem.

Additional input: Another participant offered to help implement custom code if given the store URL and asked whether the badge should appear across all pages. They also suggested using a page builder app for more flexibility.

Current status: No confirmed fix yet. A follow-up request asked for an updated/corrected code snippet so the correct percentage displays. The discussion remains open.

Key details/terms:

  • product-grid-item.liquid: The theme snippet where the sale badge text is set.
  • compare_at_price_max vs. price: Values used to calculate the discount percentage. The current formula needs correction to avoid always showing 0%.
Summarized with AI on January 16. AI used: gpt-5.

Hi David,

Good day!

Just wanted to check if you have an update on the correct coding as per attached so correct percentage will show up?

Thank you so much!