WC_Order::get_cancel_endpoint()publicWC 1.0

Helper method to return the cancel endpoint.

Method of the class: WC_Order{}

No Hooks.

Return

String. the cancel endpoint; either the cart page or the home page.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_cancel_endpoint();

WC_Order::get_cancel_endpoint() code WC 8.7.0

public function get_cancel_endpoint() {
	$cancel_endpoint = wc_get_cart_url();
	if ( ! $cancel_endpoint ) {
		$cancel_endpoint = home_url();
	}

	if ( false === strpos( $cancel_endpoint, '?' ) ) {
		$cancel_endpoint = trailingslashit( $cancel_endpoint );
	}

	return $cancel_endpoint;
}