WordPress教程:WooCommerce替换“Free!”产品字符串

经过 小朱笔记 | 3 月 17, 2019 | WordPress技巧 | 0条评论

替换“Free!”产品字符串

/**
 * WooCommerce Extra Feature
 * --------------------------
 *
 * Replace "Free!" by a custom string
 *
 */
function woo_my_custom_free_message() {
  return "This product is FREE!";
}
 
add_filter('woocommerce_free_price_html', 'woo_my_custom_free_message');

在哪里添加此代码?

将PHP代码放在主题或子主题functions.php文件的底部。

0条评论

提交评论

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理