I am adding a custom payment gateway to WP Woocommerce.
I want to get the current user order_id for the cart created.

I can get the cart total :

global $woocommerce;
$total= $woocommerce->cart->total ;

or with :

WC()->cart->get_total() ;

I tried many options. But I can’t get the $order_id .
Please Help.

Read more here: Get current Order ID for Woocommerce user cart


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: