rder Order object. * @return string */ protected function render_order_details_table_items( $order ) { $return = ''; $order_items = array_filter( // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) ), function( $item ) { // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment return apply_filters( 'woocommerce_order_item_visible', true, $item ); } ); foreach ( $order_items as $item_id => $item ) { $product = $item->get_product(); $return .= $this->render_order_details_table_item( $order, $item_id, $item, $product ); } return $return; } /** * Render an item in the order details table. * * @param \WC_Order $order Order object. * @param integer $item_id Item ID. * @param \WC_Order_Item $item Item object. * @param \WC_Product|false $product Product object if it exists. * @return string */ protected function render_order_details_table_item( $order, $item_id, $item, $product ) { $is_visible = $product && $product->is_visible(); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $row_class = apply_filters( 'woocommerce_order_item_class', 'woocommerce-table__line-item order_item', $item, $order ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $item_name = apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '%s', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ); $qty = $item->get_quantity(); $refunded_qty = $order->get_qty_refunded_for_item( $item_id ); $qty_display = $refunded_qty ? '' . esc_html( $qty ) . ' ' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '' : esc_html( $qty ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $item_qty = apply_filters( 'woocommerce_order_item_quantity_html', '' . sprintf( '× %s', $qty_display ) . '', $item ); return ' ' . wp_kses_post( $item_name ) . '  ' . wp_kses_post( $item_qty ) . ' ' . $this->get_hook_content( 'woocommerce_order_item_meta_start', [ $item_id, $item, $order, false ] ) . ' ' . wc_display_item_meta( $item, [ 'echo' => false ] ) . ' ' . $this->get_hook_content( 'woocommerce_order_item_meta_end', [ $item_id, $item, $order, false ] ) . ' ' . $this->render_order_details_table_item_purchase_note( $order, $product ) . ' ' . wp_kses_post( $order->get_formatted_line_subtotal( $item ) ) . ' '; } /** * Render an item purchase note. * * @param \WC_Order $order Order object. * @param \WC_Product|false $product Product object if it exists. * @return string */ protected function render_order_details_table_item_purchase_note( $order, $product ) { // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment $show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) ); $purchase_note = $product ? $product->get_purchase_note() : ''; return $show_purchase_note && $purchase_note ? '
' . wp_kses_post( $purchase_note ) . '
' : ''; } /** * Render order details table totals. * * @param \WC_Order $order Order object. * @return string */ protected function render_order_details_table_totals( $order ) { add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_empty_string' ); $return = ''; $total_rows = array_diff_key( $order->get_order_item_totals(), array( 'cart_subtotal' => '', 'payment_method' => '', ) ); foreach ( $total_rows as $total ) { $return .= ' ' . esc_html( $total['label'] ) . ' ' . wp_kses_post( $total['value'] ) . ' '; } return $return; } /** * Render customer note. * * @param \WC_Order $order Order object. * @return string */ protected function render_order_details_customer_note( $order ) { if ( ! $order->get_customer_note() ) { return ''; } return '
' . '

' . esc_html__( 'Note:', 'woocommerce' ) . '

' . '

' . wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ) . '

' . '
'; } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation\Totals" not found in /htdocs/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php:106 Stack trace: #0 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('') #1 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #2 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /htdocs/wp-settings.php(704): do_action('init') #4 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #5 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #6 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #7 /htdocs/index.php(17): require('/htdocs/wp-blog...') #8 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php on line 106