Hi @toddi2303!
Checkout fields are saved as an order meta values, so any $order->get_meta('_<field_name>')
should be able to retrieve custom values (mind the underscore at the beginning of the field name).
Alternatively, there’s a class \WPDesk\FCF\Free\Integration\Integrator
in our codebase, which provides an API to access fields and its values in specified order. To make use of this class, you need to hook into flexible_checkout_fields/init
.
Here’s an example for getting order field value:
add_action(
'flexible_checkout_fields/init',
static function ( $integrator ) {
// Get value of custom field for order #13.
$field = $integrator->get_field_value( 'custom_field', 13 );
// ...
}
);