save metadata to the actual order.
-
Help. This is my code to add Custom Details as Order Line Item.
add_action( 'woocommerce_checkout_create_order_line_item', 'wdm_add_custom_order_line_item_meta',10,4 ); function wdm_add_custom_order_line_item_meta($item, $cart_item_key, $values, $order) { if(array_key_exists('wdm_name', $values)) { $item->add_meta_data('_wdm_name',$values['wdm_name']); } }
But I also want to save the meta_data to the order itself as a whole. How to do that?
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘save metadata to the actual order.’ is closed to new replies.