Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如果“;运送至不同地址”;检查_Php_Wordpress_Woocommerce_Hook Woocommerce - Fatal编程技术网

Php 如果“;运送至不同地址”;检查

Php 如果“;运送至不同地址”;检查,php,wordpress,woocommerce,hook-woocommerce,Php,Wordpress,Woocommerce,Hook Woocommerce,有人能告诉我如何检测是否选中了“发送到不同地址”吗? 我希望在客户选中复选框“配送到不同地址”时取消设置自定义账单字段 我试过这个,但没有成功: add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { parse_str(html_entity_decode($instance),

有人能告诉我如何检测是否选中了“发送到不同地址”吗? 我希望在客户选中复选框“配送到不同地址”时取消设置自定义账单字段

我试过这个,但没有成功:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {

parse_str(html_entity_decode($instance), $postData);
if ( $postData['ship_to_different_address']  ) {
    unset($fields['billing']['billing_pp']);
    unset($fields['billing']['billing_cc']);
}
return $fields;
}