Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFieldsFrontend::render_order_other_fields()publicWC 1.0

Renders additional fields on the order details page.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$CheckoutFieldsFrontend = new CheckoutFieldsFrontend();
$CheckoutFieldsFrontend->render_order_other_fields( $order );
$order(WC_Order) (обязательный)
Order object.

Код CheckoutFieldsFrontend::render_order_other_fields() WC 9.6.0

public function render_order_other_fields( $order ) {
	$fields = array_merge(
		$this->checkout_fields_controller->get_order_additional_fields_with_values( $order, 'contact', 'other', 'view' ),
		$this->checkout_fields_controller->get_order_additional_fields_with_values( $order, 'order', 'other', 'view' ),
	);

	if ( ! $fields ) {
		return;
	}

	echo '<section class="wc-block-order-confirmation-additional-fields-wrapper">';
	echo '<h2>' . esc_html__( 'Additional information', 'woocommerce' ) . '</h2>';
	echo $this->render_additional_fields( $fields ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	echo '</section>';
}