跳到内容

SMNTCS Show Sale Price Date for WooCommerce

v2.0

Niels Lange · 2020年3月21日 上架

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

正在使用
10 以下
评分
5.0 / 5
累计下载
2,534
最近更新
2026年9月27日
1 条评价需要 WordPress 5.3+已测试到 7.1.5PHP 7.4+

贡献者

截图

SMNTCS Show Sale Price Date for WooCommerce

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.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums