How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026

Last updated on August 2nd, 2024 at 12:35 pm

Displaying the sale price end date on your WooCommerce store can create a sense of urgency, encouraging customers to make a purchase before the discount period ends. This guide will show you how to display the sale price end date on both the shop and single product pages without using a plugin. By implementing this feature, you can enhance your store’s appeal and drive more sales.

Why Display the Sale Price End Date?

  1. Create Urgency: Letting customers know when a sale ends can prompt quicker purchasing decisions.
  2. Transparency: Provides clear information to customers about the duration of your discounts.
  3. Increased Engagement: Encourages customers to revisit your store to check for future sales.

Step 1: Add the End Date to the Single Product Page

First, we need to display the sale end date on the single product page. Add the following code to your theme’s functions.php file:

/*
 * Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Display sale end date on single product page"
*/ function wcsuccess_display_sale_end_date_single_product() { global $product; if ($product->is_on_sale()) { $sale_end_date = get_post_meta($product->get_id(), '_sale_price_dates_to', true); if ($sale_end_date) { echo '<p class="sale-end-date">Sale ends on: ' . date('F j, Y', $sale_end_date) . '</p>'; } } } add_action('woocommerce_single_product_summary', 'wcsuccess_display_sale_end_date_single_product', 25);

Step 2: Add the End Date to the Shop Page

Next, we need to display the sale end date on the shop (archive) page. Add the following code to your theme’s functions.php file:

/*
 * Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Display sale end date on shop page"
*/ function wcsuccess_display_sale_end_date_shop_page() { global $product; if ($product->is_on_sale()) { $sale_end_date = get_post_meta($product->get_id(), '_sale_price_dates_to', true); if ($sale_end_date) { echo '<p class="sale-end-date">Sale ends on: ' . date('F j, Y', $sale_end_date) . '</p>'; } } } add_action('woocommerce_after_shop_loop_item', 'wcsuccess_display_sale_end_date_shop_page', 25);

Step 3: Style the Sale End Date

To make the sale end date visually appealing, add some CSS to your theme’s stylesheet (style.css). Here’s an example of how you might style it:

/*
 * Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Style the sale end date"
*/ .sale-end-date { font-size: 14px; color: #FF0000; font-weight: bold; margin-top: 10px; }

Use Cases for Displaying Sale End Date

  1. Holiday Sales: Inform customers about the end date of holiday-specific discounts to boost urgency and sales during peak shopping seasons.
  2. Limited-Time Offers: Use this feature to highlight limited-time offers, encouraging customers to purchase before the discount period ends.
  3. Clearance Sales: Display end dates for clearance items to push sales before the stock runs out.
  4. Marketing Campaigns: Combine the end date display with marketing campaigns to drive traffic and conversions.
  5. Customer Trust: By being transparent about sale durations, you build trust with your customers, showing that your discounts are genuine and time-limited.
See also  How to Change Product Tab Titles and Headings in WooCommerce - 2026

Conclusion

Displaying the sale price end date on both the shop and single product pages in WooCommerce is a powerful way to drive sales and create a sense of urgency. By following the steps outlined above, you can easily implement this feature without using a plugin, enhancing the shopping experience for your customers and boosting your store’s performance.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
×