add order item meta
Viewing 2 Posts - 1 through 2 (of 2 total)
Author | Posts |
---|---|
July 1, 2015 at 1:24 am 53814 | |
Nayem | I am attempting to add order item meta. I have successfully stored the meta using the following code: function add_order_item_meta($item_id, $values, $cart_item_key) { $addMeta = 'some value'; wc_add_order_item_meta($item_id, '_meta_key', $addMeta, false); } add_action('woocommerce_add_order_item_meta', 'add_order_item_meta', 10, 3); This works well for the parent order, however when dokan splits the order when there are multiple sellers this breaks. for example: if a customer makes an order with two products from different sellers and the main order has the order id of 1. dokan then breaks this order up creating order 2 and 3. These items in the new orders(order 2 and 3) are given different order_item_id's from the parent order (order 1). I need the meta values to be stored with the order_item_id's for order 2 and 3. Is there a hook for this that I am missing? |
July 2, 2015 at 3:03 am 53975 | |
Bryan | I have solved the issue. I am not sure if there is a better way to do this than what I did. Please let me know if there is a better way to do this with a different hook!?!? What I did was include the following code:
|
July 2, 2015 at 12:26 pm 54018 | |
Nayem | Hello Bryan, I am very glad to know that you have solved your issue. I hope this code will help our others user. Thanks. |
Viewing 2 Posts - 1 through 2 (of 2 total)