From a6e4e60cbf0848fa891d8799b76d741c06134a6f Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Mon, 4 Dec 2023 12:33:07 +0100 Subject: [PATCH] Use fee name on receipt template --- templates/receipt.php | 49 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/templates/receipt.php b/templates/receipt.php index 1210040..541a32c 100644 --- a/templates/receipt.php +++ b/templates/receipt.php @@ -145,17 +145,17 @@ * This hook adds the javascript to print the receipt. */ do_action( 'woocommerce_pos_receipt_head' ); -?> + ?> >
+ $header_image = get_theme_mod( 'custom_logo' ); + if ( $header_image ) { + $image_attributes = wp_get_attachment_image_src( $header_image, 'full' ); + $src = $image_attributes[0]; + ?> <?php bloginfo( 'name' ); ?>

@@ -173,14 +173,14 @@ get_date_created(), 'F j, Y, g:i a' ) ); ?> get_meta( '_pos_user' ); -if ( $pos_user ) { - $user = get_user_by( 'id', $pos_user ); - $user_name = $user->display_name; - echo '
  • ' . esc_html__( 'Cashier:', 'woocommerce-pos' ) . ' ' . esc_html( $user_name ) . '
  • '; -} -?> + // if order has meta value _pos_user, get the user id and display the user name + $pos_user = $order->get_meta( '_pos_user' ); + if ( $pos_user ) { + $user = get_user_by( 'id', $pos_user ); + $user_name = $user->display_name; + echo '
  • ' . esc_html__( 'Cashier:', 'woocommerce-pos' ) . ' ' . esc_html( $user_name ) . '
  • '; + } + ?> get_payment_method_title() ) { ?>
  • @@ -199,7 +199,8 @@ - get_items() as $item_id => $item ) { + get_items() as $item_id => $item ) { $product = $item->get_product(); ?> @@ -207,15 +208,15 @@ get_name(), $item, false ) ); - do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); + do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); - wc_display_item_meta( $item ); + wc_display_item_meta( $item ); - do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); - ?> + do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); + ?> get_quantity() ); ?> - get_price() ) ) : ''; ?> + get_price() ) ) : ''; ?> get_total() ) ); ?> @@ -233,7 +234,7 @@ get_fees() as $fee ) { ?> - + get_name() ); ?> get_total() ) ); ?> @@ -316,12 +317,10 @@
  • -