add_filter('woocommerce_product_get_regular_price', 'custom_price' , 99, 2 );
function custom_price( $price, $product )
{
$price = $price - 2;
return $price
}
这在任何地方都可以使用[[(在商店,购物车中,在后端中],但在我的自定义产品列表插件中无效:
add_action( 'woocommerce_account_nybeorderlist_endpoint', 'patrickorderlist_my_account_endpoint_content' );
function patrickorderlist_my_account_endpoint_content() {
//All WP_Query
echo wc_price($price);
}
[使用WooCommerce,我可以使用以下功能对商品价格进行折扣:add_filter('woocommerce_product_get_regular_price','custom_price',99,2);函数...