MainWP Community

Set checkout fields max length in WooCommerce

Set checkout fields max length in WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_checkout_fields', 'wc_checkout_fields_custom_attributes', 9999 );

function wc_checkout_fields_custom_attributes( $fields ) {
	$fields['billing']['billing_company']['maxlength'] = 15;
	return $fields;
}
1 Like