Answers for "retrieve the order Id on Order pay page"

PHP
0

retrieve the order Id on Order pay page

global $wp;

if ( isset($wp->query_vars['order-pay']) && absint($wp->query_vars['order-pay']) > 0 ) {
    $order_id = absint($wp->query_vars['order-pay']); // The order ID

    $order    = wc_get_order( $order_id ); // Get the WC_Order Object instance
}
Posted by: Guest on October-14-2021

Code answers related to "retrieve the order Id on Order pay page"

Browse Popular Code Answers by Language