I like to get all available checkout fields, including third party ones:
$fields = WC()->checkout()->checkout_fields;
returns a fatal err
i was facing the same issue . here's how i managed it .
class my_checkout_fields_class {
var $countries;
function __construct() {
$this->countries = new WC_Countries();
}
}
Now you can get billing and shipping fields respectively in this class.
$billlingfields = $this->countries->get_address_fields( $this->countries->get_base_country(),'billing_');
$shippingfields = $this->countries->get_address_fields( $this->countries->get_base_country(),'shipping_');
regards