Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::sync_customer_additional_fields_with_order()
Copies additional fields from an order to a customer.
Метод класса: CheckoutFields{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$CheckoutFields = new CheckoutFields(); $CheckoutFields->sync_customer_additional_fields_with_order( $order, $customer );
- $order(WC_Order) (обязательный)
- The order to sync the fields for.
- $customer(WC_Customer) (обязательный)
- The customer to sync the fields for.
Код CheckoutFields::sync_customer_additional_fields_with_order() CheckoutFields::sync customer additional fields with order WC 9.8.1
public function sync_customer_additional_fields_with_order( WC_Order $order, WC_Customer $customer ) { foreach ( $this->groups as $group ) { $order_additional_fields = $this->get_all_fields_from_object( $order, $group, true ); // Sync customer additional fields with order additional fields. foreach ( $order_additional_fields as $key => $value ) { if ( $this->is_customer_field( $key ) ) { $this->persist_field_for_customer( $key, $value, $customer, $group ); } } } }