SMNTCS Show Sale Price Date for WooCommerce

By Niels Lange

★ 5.0/5 (1 ratings)0+ active installationsVersion 2.0

Shows the date a WooCommerce sale ends next to the sale price on the product page.

Description

SMNTCS Show Sale Price Date for WooCommerce tells your customers how long a sale lasts. When a product has a scheduled sale with an end date, the date appears next to the sale price on the product page, for example “(Discounted until 31 December 2026)”.

For variable products the latest end date of all variations on sale is shown. Products whose sale has no end date keep their normal price display.

You can change the label in the Customizer under WooCommerce, then Show Sale Price Date.

Filters

Add these lines to your theme’s functions.php file or a small plugin.

Change the date format to any PHP date format:

add_filter( 'sale_date_format', function () { return 'j F Y'; } );

Change the label in code instead of the Customizer:

add_filter( 'sale_date_label', function () { return 'Valid until'; } );<h3>Contribute</h3>

Contributions are always welcome. Simply head over to GitHub and create an issue or open a pull request.

Installation

  1. Upload smntcs-woocommerce-show-sale-price-date to the /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.

Screenshots

Changelog

2.0 (2026.09.27)

  • Fix the formatting of the filter examples in the readme

1.9 (2026.09.26)

  • Test up to WordPress 7.1
  • Update development dependencies and GitHub Actions
  • Test up to WooCommerce 11.1
  • Fix a fatal error with WooCommerce 11.1 in the product list, the REST API and the Cart and Checkout blocks
  • Stop showing a 1970 date for sales without an end date
  • Show the date only for the product the page is about, not for related products
  • Declare compatibility with High-Performance Order Storage and the Cart and Checkout blocks

1.8 (2024.12.31)

  • Test up to WordPress 6.7

1.7 (2024.10.28)

  • Test up to WordPress 6.6

1.6 (2022.12.03)

1.5 (2022.10.08)

  • Test up to WooCommerce 6.9
  • Test up to WordPress 6.0

1.4 (2022.01.09)

  • Test up to WordPress 5.9

1.3 (2020.05.09)

1.2 (2020.03.21)

1.1 (2020.03.21)

1.0 (2020.03.14)

  • Initial release