如何在類別視圖和產品頁面中使用片段向我的 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 關注
- 223 瀏覽
添加回答
舉報
0/150
提交
取消