
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.
Screenshots
