【发布时间】:2021-03-16 07:33:04
【问题描述】:
通过以下钩子,我将文本添加到总价格中:
add_filter( 'woocommerce_cart_totals_order_total_html', 'custom_total_message_html', 10, 1 );
function custom_total_message_html( $value ) {
$text_to_add_before_price = 'excl. BTW '; //change text in quotes to your preferred text
return $text_to_add_before_price . $value;
}
只有我在感谢页面上看到它没有显示在表格中。是否可以仅在“总计”行中为价格添加文本?
在示例中为:20.35 欧元,但这应该是 20.35 欧元,不包括在内。增值税。使用当前的钩子,这仅在购物车和结帐页面中完成
【问题讨论】:
标签: php wordpress woocommerce hook-woocommerce orders