Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::persist_field_for_customerpublicWC 1.0

Persists a field value for a given customer.

Method of the class: CheckoutFields{}

No Hooks.

Returns

null. Nothing (null).

Usage

$CheckoutFields = new CheckoutFields();
$CheckoutFields->persist_field_for_customer( $key, $value, $customer, $group );
$key(string) (required)
The field key.
$value(mixed) (required)
The field value.
$customer(WC_Customer) (required)
The customer to persist the field for.
$group(string)
The group to persist the field for (shipping|billing|other).
Default: 'other'

CheckoutFields::persist_field_for_customer() code WC 9.9.3

public function persist_field_for_customer( string $key, $value, WC_Customer $customer, string $group = 'other' ) {
	$group = $this->prepare_group_name( $group );
	$this->set_array_meta( $key, $value, $customer, $group );
}