I am trying to update the price of the items in a Bundled product as follows:
add_action('woocommerce_checkout_create_order_line_item', array($this, 'misha_add_order_item_meta'), 10, 4);
public function misha_add_order_item_meta($item, $cart_item_key, $values, $order)
{ if (isset($values['cartbundles'])) {
foreach ($values['cartbundles'] as $key => $value) {
$item->update_meta_data('_line_subtotal', $value['line_subtotal']);
}
}}
The Reason i am trying to update the "_line_subtotal" is because Woocommerce only update the Bundle but not the line items in the Bundle.
SO, far nothing happens, the Cost and Total column is still Zero.
when i try:
foreach ($order->get_items() as $item_id => $item) {}
The item_id and item dont give me any response even empty array or something.
I would like to store the price of the item as part of the order.

