WC_Order::get_checkout_order_received_url PHP Method

get_checkout_order_received_url() public method

Generates a URL for the thanks page (order received).
    public function get_checkout_order_received_url()
    {
        $order_received_url = wc_get_endpoint_url('order-received', $this->get_id(), wc_get_page_permalink('checkout'));
        if ('yes' === get_option('woocommerce_force_ssl_checkout') || is_ssl()) {
            $order_received_url = str_replace('http:', 'https:', $order_received_url);
        }
        $order_received_url = add_query_arg('key', $this->get_order_key(), $order_received_url);
        return apply_filters('woocommerce_get_checkout_order_received_url', $order_received_url, $this);
    }

Usage Example

 /**
  * Get the return url (thank you page)
  *
  * @param WC_Order $order
  * @return string
  */
 public function get_return_url($order = null)
 {
     if ($order) {
         $return_url = $order->get_checkout_order_received_url();
     } else {
         $return_url = wc_get_endpoint_url('order-received', '', wc_get_page_permalink('checkout'));
     }
     if (is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes') {
         $return_url = str_replace('http:', 'https:', $return_url);
     }
     return apply_filters('woocommerce_get_return_url', $return_url);
 }
All Usage Examples Of WC_Order::get_checkout_order_received_url
WC_Order