Created
November 4, 2017 08:25
-
-
Save bhavik-kiri/3ea6247fb4c707f0a6610335ed6c64a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add order item meta. | |
*/ | |
add_action( 'woocommerce_add_order_item_meta', 'add_order_item_meta' , 10, 2); | |
function add_order_item_meta ( $item_id, $values ) { | |
if ( isset( $values [ 'custom_data' ] ) ) { | |
$custom_data = $values [ 'custom_data' ]; | |
wc_add_order_item_meta( $item_id, 'Name', $custom_data['customer_name'] ); | |
wc_add_order_item_meta( $item_id, 'Message', $custom_data['customer_message'] ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment