Add Product Weight and Dimensions to Invoice
-
Hello,
I would like to add Product Weight and Dimensions to the Invoice using the following method but replacing the ‘your_meta_field_name’ with ‘width’ or ‘weight’ does not work. Is this at all possible?
function example_custom_order_fields( $fields, $order ) { $new_fields = array(); if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) { $new_fields['your_meta_field_name'] = array( 'label' => 'VAT', 'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ); } if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) { $new_fields['your_meta_field_name'] = array( 'label' => 'Customer Number', 'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ); } return array_merge( $fields, $new_fields ); } add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
Thank you! ??
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Add Product Weight and Dimensions to Invoice’ is closed to new replies.