/** * * Save the order id of the newly created order in the post meta of the cart object */ public function save_order_id($order_id) { if (function_exists('get_product')) { $session = COOKIEVALUE; } else { $session = session_id(); } if (WP_DEBUG == true) { assert($order_id > 0); } //$customer_id = get_post_meta($order_id, '_customer_user', true); if (!is_restricted_role()) { $receipt = new AV8_Cart_Receipt($session); $id = $receipt->get_id_from_session($session); $receipt->save_conversion(); global $woocommerce; //We need the woo object to get billing info to replace the name fields for Guest Checkouts $receipt->save_order_id($order_id, $woocommerce); } }