Getting the 'key' value from the Ordered Items List (in Admin)
-
Hi,
I am trying to write some code to show some custom meta data for an ordered item (I plan on putting the meta data in the wp_woocommerce_order_itemmeta table). But I want it to show up as a column in the Order Items header in the Admin order page.
But in order to do this I need the id of the order_item_id, any ideas how I can do that? I have gotten it before with another custom script where I used get_items() and then foreach ( $items_list as $key => $item ) – however I am not sure how to do that from the Admin page.
Here is what I have thus far…..
add_action( 'woocommerce_admin_order_item_values', 'xchange_woocommerce_admin_order_item_values', 10, 3 ); function xchange_woocommerce_admin_order_item_values($_product, $item, $item_id = null) { $value = $_product->post->ID; // <-- THIS GIVE ME THE PRODUCT ID ONLY echo '<td>' . $value . '</td>'; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Getting the 'key' value from the Ordered Items List (in Admin)’ is closed to new replies.