I have purchased the Woocommerce Subscriptions plugin and i want to be able to get the order ID in checkout page.
I want this, because when a subscription is about to end, an email with a payment link is sent to the customer and an order is automatically added. When customer clicks the link, it redirects to the checkout page in order to pay for the order.
I need the order ID to retrieve meta data from the specific order using some function like wc_get_order_item_meta().
3 comments
Comments are closed.
You can get it like this:
This is stored in the
WC_Order
class as a property. This means you can use:Get an order at the checkout page, mmmm, don’t think an order exists at this point, only a cart.