Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

Status::render_confirmation_notice()protectedWC 1.0

If the order is invalid or there is no permission to view the details, tell the user to check email or log-in.

Метод класса: Status{}

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->render_confirmation_notice( $order );
$order(\WC_Order|null)
Order object.
По умолчанию: null

Код Status::render_confirmation_notice() WC 9.4.2

protected function render_confirmation_notice( $order = null ) {
	if ( ! $order ) {
		$content = '<p>' . esc_html__( 'If you\'ve just placed an order, give your email a quick check for the confirmation.', 'woocommerce' );

		if ( wc_get_page_permalink( 'myaccount' ) ) {
			$content .= ' ' . sprintf(
				/* translators: 1: opening a link tag 2: closing a link tag */
				esc_html__( 'Have an account with us? %1$sLog in here to view your order details%2$s.', 'woocommerce' ),
				'<a href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '" class="button">',
				'</a>'
			);
		}

		$content .= '</p>';

		return $content;
	}

	$permission = $this->get_view_order_permissions( $order );

	if ( $permission ) {
		return '';
	}

	$verification_required  = $this->email_verification_required( $order );
	$verification_permitted = $this->email_verification_permitted( $order );
	$my_account_page        = wc_get_page_permalink( 'myaccount' );

	$content  = '<p>';
	$content .= esc_html__( 'Great news! Your order has been received, and a confirmation will be sent to your email address.', 'woocommerce' );
	$content .= $my_account_page ? ' ' . sprintf(
		/* translators: 1: opening a link tag 2: closing a link tag */
		esc_html__( 'Have an account with us? %1$sLog in here%2$s to view your order.', 'woocommerce' ),
		'<a href="' . esc_url( $my_account_page ) . '" class="button">',
		'</a>'
	) : '';

	if ( $verification_required && $verification_permitted ) {
		$content .= ' ' . esc_html__( 'Alternatively, confirm the email address linked to the order below.', 'woocommerce' );
	}

	$content .= '</p>';

	if ( $verification_required && $verification_permitted ) {
		$content .= $this->render_verification_form();
	}

	return $content;
}