I'm trying to change order item names of existing order product by using this codes
$order = wc_get_order('14851');
foreach($order->get_items() as $item_id => $item_obj){
$item_obj->set_name($current_product_name.' Append This (S10)');
}
Woocommerce Documentation: Class WC_Order_item: set_name() method
But it doesn't working at all. Can someone have an idea to make this work?