Add customer full name to receipt
-
Hi. I would like to know how to add the customer name into the info section of my receipts. I have looked at the examples to edit the functions file in my child theme and have managed to get this far:
// Print Customer Surname on Receipts function customer_name_order_fields( $fields, $order ) { $new_fields = array(); if( get_post_meta( $order->get_ID(), 'billing_last_name', true ) ) { $new_fields['billing_last_name'] = array( 'label' => 'Customer Surname', 'value' => get_post_meta( $order->get_ID(), 'billing_last_name', true ) ); } return array_merge( $fields, $new_fields ); } add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
…I used this example to see if I could start with getting just the surname, but even that didn’t work. I wondered if anyone might be a lot more clever than me :0)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add customer full name to receipt’ is closed to new replies.