如何在类别视图和产品页面中使用片段向我的 Woocoomerce 价格添加自定义文本?function sv_change_product_html( $price_html, $product ) { $unit_price = get_post_meta( $product->id, 'unit_price', true ); if ( ! empty( $unit_price ) ) { $price_html = '<span class="amount">' . wc_price( $unit_price ) . ' / Stück</span>'; } return $price_html;}add_filter( 'woocommerce_get_price_html', 'sv_change_product_html', 10, 2 );
2 回答
- 2 回答
- 0 关注
- 207 浏览
添加回答
举报
0/150
提交
取消