//1:
update_post_meta( $order_id, '_order_shipping', '313' );
//2:
$order = new WC_Order( $order_id );
$order->calculate_totals();
$order->save();
After executing code 2, code 1 becomes ineffective!
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
//1:
update_post_meta( $order_id, '_order_shipping', '313' );
//2:
$order = new WC_Order( $order_id );
$order->calculate_totals();
$order->save();
After executing code 2, code 1 becomes ineffective!