Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

Totals::render_content()protectedWC 1.0

This renders the content of the block within the wrapper.

Method of the class: Totals{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->render_content( $order, $permission, $attributes, $content );
$order(\WC_Order) (required)
Order object.
$permission(string|false)
If the current user can view the order details or not.
Default: false
$attributes(array)
Block attributes.
Default: []
$content(string)
Original block content.
Default: ''

Totals::render_content() code WC 9.0.1

protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) {
	if ( ! $permission ) {
		return $this->render_content_fallback();
	}
	$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes, [ 'border_color', 'border_radius', 'border_width', 'border_style', 'background_color', 'text_color' ] );

	return $this->get_hook_content( 'woocommerce_order_details_before_order_table', [ $order ] ) . '
		<table cellspacing="0" class="wc-block-order-confirmation-totals__table ' . esc_attr( $classes_and_styles['classes'] ) . '" style="' . esc_attr( $classes_and_styles['styles'] ) . '">
			<thead>
				<tr>
					<th class="wc-block-order-confirmation-totals__product">' . esc_html__( 'Product', 'woocommerce' ) . '</th>
					<th class="wc-block-order-confirmation-totals__total">' . esc_html__( 'Total', 'woocommerce' ) . '</th>
				</tr>
			</thead>
			<tbody>
				' . $this->get_hook_content( 'woocommerce_order_details_before_order_table_items', [ $order ] ) . '
				' . $this->render_order_details_table_items( $order ) . '
				' . $this->get_hook_content( 'woocommerce_order_details_after_order_table_items', [ $order ] ) . '
			</tbody>
			<tfoot>
				' . $this->render_order_details_table_totals( $order ) . '
				</tfoot>
				</table>
		' . $this->render_order_details_customer_note( $order ) . '
		' . $this->get_hook_content( 'woocommerce_order_details_after_order_table', [ $order ] ) . '
		' . $this->get_hook_content( 'woocommerce_after_order_details', [ $order ] ) . '
	';
}