1
I’m having a problem with the object order of wordpress. After making the purchase, the order object does not come with the value entered in the field. The CPF field is created by me, follow the code:
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_cpf'] = array(
'label' => __('CPF', 'woocommerce'),
'required' => true,
'class' => array('input-text'),
'clear' => true,
'type' => "text",
"name" => "billing_cpf",
);
return $fields;
}
The field appears on the screen, but its value is not sent in the array $order->data['billing']
.
How do I receive its value? I’m using the plugin Woocommerce, and created another (plugin) to make these changes.