Complete checkout for all orders Drupal commerce
I fixed this issue by adding this PHP code:


$orders = commerce_order_load_multiple(array(), array('status'=>'cart'), TRUE);
foreach($orders as $order){
    $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
    foreach($order_wrapper->commerce_line_items as $line_item_wrapper){
        $product = $line_item_wrapper->commerce_product;
        $node_product = $node_wrapper->field_product;
            $order_wrapper->status = 'invoiced';
            $line_item_wrapper->save();
            $order_wrapper->save();
    }
}