I’d like to add a new custom billing field in my woocommerce checkout. After adding the following code inside my child theme functions.php, saved it and refreshed the page, I received a blank page. There was no error message. I believe there must be syntax error or something.
add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');
function custom_override_checkout_fields($fields) {
$fields['shipping']['about_yourself'] = array(
'label' => __('About yourself', 'woocommerce'),
'placeholder' => _x('About yourself', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide');
'clear' => true
);
return $fields;
}
I was wondering if anyone could help me out.
Thank you in advance
The error is in your array field that should be like:
NOTE: During development process to enable the
error_reporting()
and set WP_DEBUG true. This is how you enable it during WordPress development in wp-config.php fileYou have added
;
instead of,
in'class' => array('form-row-wide');
So your code would be :