whenever I use WC_Order()
in a plugin that I created for getting the order data I get Fatal error: Uncaught Error: Class "WC_Order" not found
What I want to achieve is getting the order data like shipping address, product name, product description and client name to make another API call that associate with the Woocommerce order
this's the simple popular code
global $woocommerce, $post;
$order = new WC_Order(1413);
$order_data = $order->get_data(); // The Order data
the error
Fatal error: Uncaught Error: Class "WC_Order" not found in C:\xampp\htdocs\wordpress\wp-content\plugins\Scalablepress\index.php