Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
Summary::render_content()
This renders the content of the block within the wrapper.
Метод класса: Summary{}
Хуков нет.
Возвращает
Строку
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_content( $order, $permission, $attributes, $content );
- $order(\WC_Order) (обязательный)
- Order object.
- $permission(строка|false)
- If the current user can view the order details or not.
По умолчанию: false - $attributes(массив)
- Block attributes.
По умолчанию: [] - $content(строка)
- Original block content.
По умолчанию: ''
Код Summary::render_content() Summary::render content 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; }