is there a way to omit this function for orders that do not have any shipping? Presently if the order does not have shipping and goes to 'completed' the function creates an error:
Fatal error: Uncaught Error: Call to a member function get_method_id() on bool Stack trace: #0 wp-includes/class-wp-hook.php(324): action_woocommerce_email_order_details() #1 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 wp-includes/plugin.php(517): WP_Hook->do_action() #3 customer-completed-order.php(38): do_action() #4 woocommerce/includes/wc-core-functions.php(345): include('/var/www/vhosts...')