Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFieldsFrontend::render_order_other_fields
Renders additional fields on the order details page.
Method of the class: CheckoutFieldsFrontend{}
No Hooks.
Returns
null. Nothing (null).
Usage
$CheckoutFieldsFrontend = new CheckoutFieldsFrontend(); $CheckoutFieldsFrontend->render_order_other_fields( $order );
- $order(WC_Order) (required)
- Order object.
CheckoutFieldsFrontend::render_order_other_fields() CheckoutFieldsFrontend::render order other fields code WC 10.8.1
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' ),
);
$context = array(
'caller' => 'CheckoutFieldsFrontend::render_order_other_fields',
'order' => $order,
);
$fields = $this->checkout_fields_controller->filter_fields_for_order_confirmation( $fields, $context );
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>';
}