Show Percentage Discounts in Shopify to Boost Sales

Published on Jun 18, 2024

By Sophia Rodriguez

#Shopify#E-commerce#Discounts
Person Using Black And White Smartphone and Holding Blue Card

In the competitive world of e-commerce, displaying discounts effectively can significantly boost sales and customer engagement. One powerful way to showcase savings is by showing percentage discounts on products. This guide will walk you through the process of adding percentage discounts to your Shopify store, focusing on the Debut theme but also providing insights for other themes.

Understanding the Importance of Displaying Discounts

Why Percentage Discounts Matter

Percentage discounts are a powerful psychological tool in e-commerce. They provide a clear, easy-to-understand value proposition for customers. When shoppers see a “20% off” tag, it immediately communicates the savings they’ll receive, often more effectively than a fixed dollar amount.

Impact on Customer Behavior

Displaying percentage discounts can:

  1. Increase perceived value
  2. Create a sense of urgency
  3. Improve conversion rates

Enhancing User Experience

By clearly showing discounts, you’re improving the overall shopping experience. Customers appreciate transparency and the ability to quickly understand the deal they’re getting.

Implementing Percentage Discounts in Shopify

The Basic Code Solution

The most straightforward way to display percentage discounts on your Shopify store is by adding a simple code snippet to your theme files. Here’s the code that can be added to display the discount percentage:

{% if compare_at_price %}
  {% capture discount %}
    {{ compare_at_price | minus:price | times:100 | divided_by:compare_at_price }}%
  {% endcapture %}
  {{ discount }}
{% endif %}

This code calculates the percentage difference between the compare-at price and the current price, displaying it as a percentage.

Where to Add the Code

For the Debut theme:

  1. Go to your Shopify admin panel
  2. Navigate to Online Store > Themes
  3. Click “Actions” > “Edit code”
  4. Find the “product-price.liquid” file
  5. Insert the code after line 12 (or where appropriate in your theme structure)

For other themes, the location might vary. Common places to add this code include:

  • Sections > product-template.liquid
  • Assets > product-price.liquid

Customizing the Display

You can further customize how the discount appears by wrapping it in HTML tags:

{% if compare_at_price %}
  {% capture discount %}
    {{ compare_at_price | minus:price | times:100 | divided_by:compare_at_price }}%
  {% endcapture %}
  <span class="discount-badge">{{ discount }} off</span>
{% endif %}

This allows you to style the discount display using CSS for better visibility and integration with your store’s design.

Advanced Techniques and Considerations

Rounding Down Discounts

To avoid potentially misleading customers with high decimal percentages, you can round down the discount:

{% assign percentDiscount = comparePrice | minus: price | times: 0.10 | divided_by: comparePrice | times: 1000.00 | floor %}

This approach ensures that the displayed discount is always slightly lower than the actual discount, maintaining customer trust.

Displaying Discounts on Collection Pages

To show discounts on collection pages, you’ll need to modify the collection template or product grid item snippet. The exact location depends on your theme, but it’s often in files like:

  • Sections > collection-template.liquid
  • Snippets > product-grid-item.liquid

Handling Multiple Variants

For products with multiple variants, ensure your code updates dynamically when a customer selects different options. This often requires JavaScript to recalculate and update the displayed discount when variant selection changes.

Troubleshooting Common Issues

Discount Not Appearing

If your discount isn’t showing up:

  1. Verify that you’ve added the code to the correct file
  2. Ensure the product has both a regular price and a compare-at price set
  3. Check for any theme-specific overrides that might be preventing the code from executing

Incorrect Calculations

If discounts are displaying but seem incorrect:

  1. Double-check your math in the Liquid code
  2. Ensure you’re using the correct price variables (price vs compare_at_price)
  3. Consider implementing rounding to avoid strange decimal percentages

Theme Compatibility

Not all themes handle custom code the same way. If you’re having persistent issues:

  1. Consult your theme’s documentation
  2. Reach out to the theme developer for guidance
  3. Consider using a Shopify app designed for discount display if manual implementation proves too challenging

Enhancing the Discount Display

Adding Visual Elements

To make your discounts stand out:

  1. Use contrasting colors for the discount badge
  2. Add icons or graphics to draw attention
  3. Animate the discount display on page load or hover

A/B Testing Different Displays

Experiment with different ways of showing discounts:

  1. Test percentage off vs. amount saved
  2. Try different placements on the product page
  3. Vary the language used (e.g., “Save 20%” vs “20% Off”)

Integrating with Other Marketing Features

Combine your discount display with:

  1. Countdown timers for limited-time offers
  2. Stock level indicators to create urgency
  3. Bundle deals to increase average order value

By implementing these strategies, you can effectively display percentage discounts on your Shopify store, potentially boosting sales and improving customer experience. Remember to always test your implementations thoroughly and monitor their impact on your store’s performance.

Take Our Quick Quiz:

Which primary product image do you think has the highest conversion rate?