How can I get the order id of a woocommerce order to use in a function in functions.php?

How can I get the order id of a woocommerce order to be used in a function in functions.php?

I would like to be able to check the id of the order(s) when at:

Read More

the woocommerce my account page (for each order):
http://example.com/my-account

and

the woocommerce checkout page (for the current order):
http://example.com/checkout/order-pay/210?pay_for_order=true&key=order_53df9a0e8116a

I know that on the check out page, the order id can be accessed through $order->id; in the form-pay.php template (located at plugins/woocommerce/templates/checkout/form-pay.php) I would like to be able to do the same from inside my theme’s functions.php file.

Related posts

Leave a Reply

1 comment