---
title: "How to get various WooCommerce page URLs"
date: "2012-07-04T19:49:26"
url: "https://www.godaddy.com/resources/skills/get-woocommerce-page-urls"
---
# How to get various WooCommerce page URLs

Here is a brief tutorial on how to add multiple WooCommerce page URLs:

## Shop URL

Get the WooCommerce Shop URL (this is the root category page) with the following:

```
$shop_page_url = get_permalink( woocommerce_get_page_id( &#039;shop&#039; ) );
```

## My Account URL

You can get the WooCommerce My Account URL by using the woocommerce_myaccount_page_id option:

```
$myaccount_page_id = get_option( &#039;woocommerce_myaccount_page_id&#039; );
if ( $myaccount_page_id ) {
  $myaccount_page_url = get_permalink( $myaccount_page_id );
}
```

## Cart URL

The WooCommerce Cart URL can be retrieved with a call to the cart object’s get_cart_url() method:

```
global $woocommerce;
$cart_url = $woocommerce-&gt;cart-&gt;get_cart_url();
```

## Checkout URL

Similar to getting the cart URL, the WooCommerce Checkout URL can be retrieved with a call to the cart object’s get_checkout_url() method:

```
global $woocommerce;
$checkout_url = $woocommerce-&gt;cart-&gt;get_checkout_url();
```

## Payment Page URL

This is the payment page URL used to collect payment information after the checkout page by redirect/hosted payment gateways. The path typically looks like /checkout/pay/. Get this URL with the following:

```
$payment_page = get_permalink( woocommerce_get_page_id( &#039;pay&#039; ) );

// make ssl if needed
if ( get_option( &#039;woocommerce_force_ssl_checkout&#039; ) == &#039;yes&#039; ) $payment_page = str_replace( &#039;http:&#039;, &#039;https:&#039;, $payment_page );
```

## Logout URL

This example will generate a WordPress logout URL that brings the user back to the Account area of the site:

```
$myaccount_page_id = get_option( &#039;woocommerce_myaccount_page_id&#039; );

if ( $myaccount_page_id ) {

  $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );

  if ( get_option( &#039;woocommerce_force_ssl_checkout&#039; ) == &#039;yes&#039; )
    $logout_url = str_replace( &#039;http:&#039;, &#039;https:&#039;, $logout_url );
}
```