I'm developing a plugin that needs to get the order ID on the final checkout page when a customer purchased a product. How do I do that? I tried
global $order
var_dump($order);
And all I see is "DESC". I need to access the current order of the customer who is looking at the page.
I need to get the order id in the frontend and add that ID to a script, also on the front end, so that when a client orders a product and pays, the page will load, show them the "Thank you, here is your order number: xxx". At that moment I need my script to, for example, execute a console.log("The oder ID is:", order_id);