# Routes

Use the routes object to generate dynamic URLs for your storefront.

Use the `routes` object to generate dynamic URLs for your storefront. Using it instead of hard-coded links makes sure your theme supports any change to the URL format, for example when the theme supports several languages.

The `routes` object has the following attributes:

## routes.root_url

Returns the base URL of the shop.

```liquid
{{ routes.root_url }}
```

```text
/
```

## routes.account_url

Returns the URL of the account page.

```liquid
{{ routes.account_url }}
```

```text
/account
```

## routes.account_login_url

Returns the URL of the account login page.

```liquid
{{ routes.account_login_url }}
```

```text
/account/login
```

## routes.account_logout_url

Returns the URL that logs the customer out of their account.

```liquid
{{ routes.account_logout_url }}
```

```text
/account/logout
```

## routes.account_register_url

Returns the URL of the account registration page.

```liquid
{{ routes.account_register_url }}
```

```text
/account/register
```

## routes.account_addresses_url

Returns the URL of the page where customers manage the addresses of their account.

```liquid
{{ routes.account_addresses_url }}
```

```text
/account/addresses
```

## routes.collections_url

Returns the URL of the collections page.

```liquid
{{ routes.collections_url }}
```

```text
/collections
```

## routes.all_products_collection_url

Returns the URL of the collection that contains all products of the shop.

```liquid
{{ routes.all_products_collection_url }}
```

```text
/collections/all
```

## routes.search_url

Returns the search URL.

```liquid
{{ routes.search_url }}
```

```text
/search
```

## routes.predictive_search_url

Returns the URL of the predictive search.

You need to pass the required query parameters of the endpoint you use.

```liquid
{{ routes.predictive_search_url }}
```

```text
/search/suggest
```

## routes.cart_url

Returns the URL of the cart.

```liquid
{{ routes.cart_url }}
```

```text
/cart
```

## routes.cart_add_url

Returns the URL to add items to the cart. You need to pass at least one item with `variant.id` or `item.key`.

```liquid
{{ routes.cart_add_url }}
```

```text
/cart/add
```

## routes.cart_change_url

Returns the URL to change the quantity of an item. You need to pass the item's `variant.id` or `line_item.key`.

```liquid
{{ routes.cart_change_url }}
```

```text
/cart/change
```

## routes.cart_clear_url

Returns the URL to clear the cart.

```liquid
{{ routes.cart_clear_url }}
```

```text
/cart/clear
```

## routes.cart_update_url

Returns the URL to update the quantity of an item. You need to pass at least one item with `variant.id`.

```liquid
{{ routes.cart_update_url }}
```

```text
/cart/update
```

## routes.product_recommendations_url

Returns the URL that serves product recommendations.

```liquid
{{ routes.product_recommendations_url }}
```

```text
/recommendations/products
```


## More properties

VersaCommerce also provides these properties on the `routes` object:

| Properties | Returns |
|---|---|
| `account_recover_url`, `account_profile_url`, `storefront_login_url`, `checkout_url`, `gdpr_url`, `revocation_url` | Storefront route URLs |
