在函数中尝试此代码。php。由于这是计费中的一个要求,我们需要将其设置为false。
// For billing email - Make them not required
add_filter( \'woocommerce_billing_fields\', \'filter_billing_fields\', 20, 1 );
function filter_billing_fields( $billing_fields ) {
// Only on checkout page
if( ! is_checkout() ) return $billing_fields;
$billing_fields[\'billing_email\'][\'required\'] = false;
return $billing_fields;
}