Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
Summary::render_content()
This renders the content of the block within the wrapper.
Method of the class: Summary{}
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: ''
Summary::render_content() Summary::render content code WC 9.4.2
protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) { if ( ! $permission ) { return ''; } $content = '<ul class="wc-block-order-confirmation-summary-list">'; $content .= $this->render_summary_row( __( 'Order #:', 'woocommerce' ), $order->get_order_number() ); $content .= $this->render_summary_row( __( 'Date:', 'woocommerce' ), wc_format_datetime( $order->get_date_created() ) ); $content .= $this->render_summary_row( __( 'Total:', 'woocommerce' ), $order->get_formatted_order_total() ); $content .= $this->render_summary_row( __( 'Email:', 'woocommerce' ), $order->get_billing_email() ); $content .= $this->render_summary_row( __( 'Payment:', 'woocommerce' ), $order->get_payment_method_title() ); $content .= '</ul>'; return $content; }