// Enable order recalculation for completed orders
add_filter( 'wc_order_is_editable', 'order_editable', 9999, 2 );
function order_editable( $allow_edit, $order ) {
if ( $order->get_status() === 'completed' ) {
$allow_edit = true;
}
return $allow_edit;
}