2

I have added below code in functions.php. the label for email field have added (optional). But I'm getting error when proceed for payment

"CustomerEmail The field Customer Email must be a email."

add_filter( 'woocommerce_billing_fields', 'email_optional_field');

function email_optional_field( $fields ) {
    $fields['billing_email']['required'] = false;
    return $fields;
}
Lavan Giri
  • 83
  • 1
  • 2
  • 6

0 Answers0