WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Routes

Checkout::process_customer() private WC 1.0

Order processing relating to customer account.

Creates a customer account as needed (based on request & store settings) and updates the order with the new customer ID. Updates the order with user details (e.g. address).

{} Это метод класса: Checkout{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->process_customer( $request );
$request(WP_REST_Request) (обязательный)
Request object.

Код Checkout::process_customer() WC 5.0.0

<?php
private function process_customer( WP_REST_Request $request ) {
	$order_controller = new OrderController();

	if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '4.7', '>=' ) ) {
		try {
			$create_account = Package::container()->get( CreateAccount::class );
			$create_account->from_order_request( $request );
			$this->order->set_customer_id( get_current_user_id() );
			$this->order->save();
		} catch ( Exception $error ) {
			switch ( $error->getMessage() ) {
				case 'registration-error-invalid-email':
					throw new RouteException(
						'registration-error-invalid-email',
						__( 'Please provide a valid email address.', 'woocommerce' ),
						400
					);
				case 'registration-error-email-exists':
					throw new RouteException(
						'registration-error-email-exists',
						__( 'An account is already registered with your email address. Please log in before proceeding.', 'woocommerce' ),
						400
					);
			}
		}
	}

	// Persist customer address data to account.
	$order_controller->sync_customer_data_with_order( $this->order );
}