Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::get_fields_for_group()publicWC 1.0

Returns all fields key for a given group.

Method of the class: CheckoutFields{}

No Hooks.

Return

String[]. Field keys.

Usage

$CheckoutFields = new CheckoutFields();
$CheckoutFields->get_fields_for_group( $group );
$group(string)
The group to get the key for (shipping|billing|other).
Default: 'other'

CheckoutFields::get_fields_for_group() code WC 9.1.2

public function get_fields_for_group( $group = 'other' ) {
	if ( 'shipping' === $group ) {
		return $this->get_fields_for_location( 'address' );
	}

	if ( 'billing' === $group ) {
		return $this->get_fields_for_location( 'address' );
	}

	return \array_merge(
		$this->get_fields_for_location( 'contact' ),
		$this->get_fields_for_location( 'order' )
	);
}