1 回答

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超8個(gè)贊
一些附加信息
HTML
<del>
標(biāo)簽HTML
<ins>
標(biāo)簽如何 -添加課程
所以你得到
function woocommerce_custom_sales_price( $price, $regular_price, $sale_price ) {
? ? $percentage = round( ( $regular_price - $sale_price ) / $regular_price * 100 ).'%';
? ? $percentage_txt = '<span class="my-class">' . __('-', 'woocommerce' ) . $percentage . '</span>';
? ? $price = '<del>' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del>
? ? <ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) . $percentage_txt : $sale_price . $percentage_txt ) . '</ins>';
? ? return $price;
}
add_filter( 'woocommerce_format_sale_price', 'woocommerce_custom_sales_price', 10, 3 );
- 1 回答
- 0 關(guān)注
- 108 瀏覽
添加回答
舉報(bào)