Create xml when order is complete for COD payment in Woocommerce

Create xml when order is complete for COD payment in Woocommerce

I am trying to create an XML file in an ftp folder of the website with the following code in my theme's function.php file:

I am trying to create an XML file in an ftp folder of the website with the following code in my theme's function.php file:

add_action('woocommerce_checkout_order_processed','woocommerce_xmlCreation');

function woocommerce_xmlCreation($order_id){ $order = new WC_Order($order_id);

if ((($order->payment_method_title)=="Cash on delivery")); {

    xmlCreate($order_id);
    upload($order_id);
}

}

The problem is that the XML is not created. And if I remove the IF statement the XML is created and the website will display checkout as we where unable to complete the order try again.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

PHP Interview Questions with Solutions: Prepare for PHP Interview

Prepare for PHP Interviews. Set Variable With php.ini File. Logic & Output Behind PHP Code Segment. Class Concept, Error & Functions in PHP. Start PHP Now!

PHP Web Application Development Company

As a top **PHP Web Application Development Company in USA**[https://www.dataeximit.com/php-development-services/](https://www.dataeximit.com/php-development-services/ "https://www.dataeximit.com/php-development-services/"), we at Data EximIT have...

Advantages of Hiring PHP Developer for your Website Project

PHP - Hypertext pre-processor, a scripting language used by many people in developing web pages, but most of us are unaware even of the full form. To train someone and make them learn this whole language is as difficult and time-consuming as it is...