Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wc php 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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wc #php #retrieve #order #Id #Order #pay #page
ADD COMMENT
Topic
Name
8+4 =