<分区>
您好,我需要更改 Woocommerce 上所选产品的产品价格
我有这个功能
add_filter( 'woocommerce_get_price_html', 'custom_price_html', 11, 2 );
function custom_price_html($price_html, $product){
if (is_product()) {
// here I change the product price or styling
}
}
问题是函数在产品页面上执行...但也在页面底部的相关产品上执行。
我怎样才能只识别当前产品价格?!
谢谢!