Shopifyで割引率を表示する方法|具体的なコードと記述箇所を紹介

How to Display Discount Rates on Shopify | With Specific Code and Where to Add It

Tsun ライターチーム

When running an online store, measures that boost customers' purchasing motivation are essential. One of the most representative methods is "discounting."

An important point when running a discount campaign is displaying the "discount rate." A discount rate is extremely appealing information for customers and directly leads to increased sales. For example, when a specific number like "30% OFF" is shown, customers can immediately see how much of a deal they're getting. This lowers the psychological barrier to purchasing and can also encourage impulse buying.

Unfortunately, however, Shopify's default features don't include a way to directly display a product's discount rate.

This article explains in detail how to display discount rates on Shopify. Use it as a reference to maximize your customers' purchasing motivation.

Please note that this article includes instructions for editing code. Editing code can potentially break your store's design or cause products to display incorrectly. If you lack sufficient knowledge of code and feel uneasy about editing it, we strongly recommend consulting a professional.

Shopify's Standard Features Don't Display Discount Rates | Can Be Addressed with Code

When you sell a product at a discounted price on Shopify, both the regular price and the discounted price are displayed, clearly communicating to customers that a discount is being applied. At this point, a "Sale" label is shown, but the standard feature does not include the ability to display a specific discount rate such as "XX% OFF."

Sale display on the Dawn theme

Displaying the discount rate strongly emphasizes the value to customers and can lead to increased sales. This feature can be achieved by writing programming code. The following sections explain the specific code with accompanying images.

If you don't have coding knowledge, you can safely and reliably implement discount rate display by consulting a professional with extensive code-editing experience, such as a "Shopify Partner" with Shopify development skills.

Preparation for Displaying Discount Rates on Shopify

To display a product's discount rate, you need to set both the discounted selling price and the pre-discount price. This can be configured on the Shopify product page.

Open the product page of the item you want to sell at a discount and scroll down to the pricing section. Enter the discounted selling price in "Price" and the pre-discount price in "Compare-at price."

Enter the discounted selling price in 'Price' and the pre-discount price in 'Compare-at price'

Image source: Shopify admin

That's all the preparation needed.

In the image above, the original price is ¥14,000 and the discounted price is ¥7,000, which comes out to 50% OFF. Let's take a look at the actual screen.

Sale display on the Dawn theme

Looking at the shoes in the middle, ¥14,000 is shown with a strikethrough, and the price is displayed as ¥7,000. Since the discount rate isn't shown yet, let's make it so "50% OFF" is displayed as well.

How to Display Discount Rates on Shopify with Code

Here's the code for displaying discount rates on Shopify. The theme used here is the official free theme "Dawn," version 15.3.0. Please note that if you're using a different version of the Dawn theme or a different theme altogether, the location where you need to add the code may differ.

Also, showing the discount rate is especially effective on a collection page where various products are listed side by side. This article introduces how to display it on a collection page, but if you'd like to display it in other sections or on product pages, please adapt the content accordingly.

Where to Edit the Code

From the Shopify admin, select Online Store. Click the "…" (ellipsis) next to the theme you want to edit, and select "Edit code."

Click the '…' (ellipsis) next to the theme you want to edit, and select 'Edit code'

Image source: Shopify admin

Before editing the code, always make a backup just in case. Click "…" (ellipsis) and select "Duplicate" to create a backup.

Once the code editor is open, select "snippets" from the menu, then select "card-product.liquid."

Once the code editor is open, select 'snippets' from the menu, then select 'card-product.liquid'

The code will appear on the right side of the screen; this is what you'll be editing.

Where to Add the Code and Its Content

In this example, the discount rate will be displayed below the price of each product shown in the collection.

The code should be inserted right after "{%- endif -%}" on line 288 and before "</div>" on line 289.

*Please note that if you're using a different theme version or a different theme, the insertion point may differ.

The code should be inserted right after '{%- endif -%}' on line 288 and before '' on line 289

Press "Enter" after "{%- endif -%}" on line 288 to create a new line.

Press 'Enter' after '{%- endif -%}' on line 288

Paste the following code into the new line 289.

{%- comment -%}
Discount rate display code
{%- endcomment -%}
{%- liquid
assign compare_at_price = card_product.compare_at_price
assign price = card_product.price
if compare_at_price > price and card_product.available
assign sale_percentage = compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round
echo '<span class="sale-badge">' | append: sale_percentage | append: '% OFF</span>'
endif
-%}
{%- style -%}
.sale-badge {
display: inline-block;
padding: 0.25rem 1.2rem;
font-size: 1.2rem;
font-weight: 500;
line-height: 1.2;
color: #FFFFFF !important;
background-color: #D93A46;
border-radius: 9999px;
text-align: center;
}
{%- endstyle -%}

The sample code inserted

After pasting, click "Save" in the top right, then click "Preview store" to check the result on the actual screen.

Click 'Save' in the top right

Looking at the collection, the discount rate is now displayed below the price of the shoes.

Discount rate displayed during a sale

If you want to change the color to match your site's theme color, edit the color codes in the code. A color code is a 6-digit alphanumeric string following the "#" symbol.

  • color: Specifies the text color
  • background-color: Specifies the background color

For example, changing the code as shown below will make the text red and the background yellow.

color: #FF0000 !important;
background-color: #FFFF00;

The discount rate color has changed

You can also change the label's appearance using CSS in other ways. That concludes this explanation.

"RuffRuff Order Bonus" Is Recommended for Running Discount Campaigns

Shopify lets you sell at a discounted price, display a "Sale" label, and issue coupons, but the standard features don't support discount campaigns beyond that.

So if you want to run discount campaigns that boost customers' purchasing motivation, we recommend "RuffRuff Order Bonus."

RuffRuff Order Bonus lets you implement all kinds of discount campaigns, including "volume discounts," "discounts based on subtotal amount," "VIP member-only discounts," and "limited-time sales." It can be set up with simple operations, without editing any code, so even those without programming knowledge can use it. The settings screen is also available in Japanese, and Japanese-language customer support is available, so beginners can use it with peace of mind.

The app is available from US$9.90/month, with a 3-day free trial. If you're considering a discount campaign, please give it a try. Pricing varies by Shopify plan (as of November 2, 2026).

Display Discount Rates on Shopify to Boost Your Customers' Purchasing Motivation

This article explained how to display discount rates for products in a Shopify store's collection.

Shopify's standard features don't include a way to display discount rates, but this can be addressed by adding programming code. Displaying "XX% OFF" on a product strongly conveys value to customers and can be expected to boost their purchasing motivation.

If you're not confident editing code, consult a professional. By working with a Shopify Partner or an experienced freelance developer, you can implement discount rate display safely and reliably, without negatively affecting your store's design or functionality.

Display discount rates to boost your customers' purchasing motivation and increase your sales.

Finally, the blog article below introduces how to set up sales on Shopify and specific sales campaign ideas. Please use it as a reference.

RuffRuff apps related to this article

👆️目次はShopifyアプリ「RuffRuff 目次作成」を利用

👆️Table of contents by the Shopify app RuffRuff Table of Contents

Back to blog
  • Shopifyに棚卸し機能が登場!管理画面・POSでの操作手順を解説

    Shopify Introduces Stock Counts: How to Use The...

    Tsun ライターチーム

    Use Shopify's built-in stock counts to count inventory by location. Learn how to create a count and approve stock discrepancies in the Shopify admin, and how to count stock in...

    Shopify Introduces Stock Counts: How to Use The...

    Tsun ライターチーム

    Use Shopify's built-in stock counts to count inventory by location. Learn how to create a count and approve stock discrepancies in the Shopify admin, and how to count stock in...

  • Shopify Flowで商品の価格・タグ・メタフィールドの変更を検知する方法

    How to detect changes to product prices, tags, ...

    Tsun ライターチーム

    Use Shopify Flow’s Product updated trigger to detect changes to prices, tags, and metafields. See how to tag products for review when prices change and how to test the workflow.

    How to detect changes to product prices, tags, ...

    Tsun ライターチーム

    Use Shopify Flow’s Product updated trigger to detect changes to prices, tags, and metafields. See how to tag products for review when prices change and how to test the workflow.

  • Shopifyのファイル管理を徹底解説|対応形式・容量上限・フォルダ整理の方法

    Shopify File Management: Formats, Storage Limit...

    Tsun ライターチーム

    Learn how to manage images, videos, and PDFs in the Shopify admin. Check supported file formats and plan limits, then learn to create folders, move files, search, and delete.

    Shopify File Management: Formats, Storage Limit...

    Tsun ライターチーム

    Learn how to manage images, videos, and PDFs in the Shopify admin. Check supported file formats and plan limits, then learn to create folders, move files, search, and delete.

  • Shopifyと連携できる外部AI7選!対応機能・接続方法を比較

    7 AI Tools That Connect to Shopify: Features an...

    Tsun ライターチーム

    Compare seven AI tools that connect to Shopify. See which ones fit tasks like adding product images, analyzing sales, and working with Microsoft 365, and check the permissions and limits...

    7 AI Tools That Connect to Shopify: Features an...

    Tsun ライターチーム

    Compare seven AI tools that connect to Shopify. See which ones fit tasks like adding product images, analyzing sales, and working with Microsoft 365, and check the permissions and limits...

  • Shopifyのストア分析・レポートを画像付きで解説|使い方からカスタマイズまで

    A visual guide to Shopify Analytics and reports...

    Tsun ライターチーム

    Learn how to break down sales and sessions in Shopify Analytics, compare data across the session measurement update, and use bubble maps, custom data, and annotations.

    A visual guide to Shopify Analytics and reports...

    Tsun ライターチーム

    Learn how to break down sales and sessions in Shopify Analytics, compare data across the session measurement update, and use bubble maps, custom data, and annotations.

  • Shopifyで1つのバリエーションに複数のバーコードを登録する方法

    Shopifyで1つのバリエーションに複数のバーコードを登録する方法

    Tsun ライターチーム

    Shopifyでは、1つの商品やバリエーションに最大20個のバーコードを登録できます。管理画面とCSVでの登録手順、SKUとの違い、Shopify POSでの活用方法、外部サービス連携時の注意点を解説します。

    Shopifyで1つのバリエーションに複数のバーコードを登録する方法

    Tsun ライターチーム

    Shopifyでは、1つの商品やバリエーションに最大20個のバーコードを登録できます。管理画面とCSVでの登録手順、SKUとの違い、Shopify POSでの活用方法、外部サービス連携時の注意点を解説します。

1 of 6
  • AI仮想顧客の改善ツール「SimGym」を使ったら売上はどうなった?実行から3か月後までの記録

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

  • 【ストアインタビュー後編】やりながら育てるShopify。「野菜をMOTTO」の試行錯誤:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

  • 【ストアインタビュー前編】 ECが主戦場でも、ECが目的ではない。「野菜をMOTTO」が貫くEC戦略:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

1 of 3
  • Our Editorial Process

    For readers new to e-commerce and Shopify, we write our articles with care to explain difficult commerce and marketing terms, along with how everything works from building a store through to selling, as “gently,” “clearly,” and “accurately” as we can.

    Learn more 
  • About the information on this site

    The information published here is based on Tsun Inc.’s own experience and research. While we make every effort to publish information that is as “current” and “accurate” as possible, we cannot fully guarantee its contents. Tsun Inc. accepts no liability whatsoever for any damages arising from this site. If you find an error in the information published here, we would be grateful if you would contact Tsun Inc.