WC_Cart::get_cart_url PHP Method

get_cart_url() public method

Gets the url to the cart page.
Deprecation: 2.5.0 in favor to wc_get_cart_url()
public get_cart_url ( ) : string
return string url to page
    public function get_cart_url()
    {
        return wc_get_cart_url();
    }

Usage Example

 /**
  * Callback function that gets called when a customer cancels the payment directly
  */
 public static function onCancel()
 {
     self::debug(__CLASS__ . ': OnCancel - URL: http' . ($_SERVER['SERVER_PORT'] == 443 ? "s://" : "://") . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
     $order = self::$wc_api->getOrderFromApiUrl();
     $order->add_order_note(__('PayPro - Customer cancelled payment. Redirected him back to his cart.'));
     self::debug(__CLASS__ . ': OnCancel - Payment cancelled by customer for order: ' . $order->id . '. Redirecting back to cart.');
     wp_safe_redirect(WC_Cart::get_cart_url());
     exit;
 }
All Usage Examples Of WC_Cart::get_cart_url
WC_Cart