The routes object

You can use the routes object to generate dynamic URLs to your storefront. By using them instead of hardcoded links, you can make sure your theme supports any changes to the URL format. For example, you can use the routes object to support multiple languages in your theme.

The routes object has the following attributes:

routes.root_url

Returns the base URL of the shop.

Input

{{ routes.root_url }}

Output

/

routes.account_url

Returns the URL for the account page.

Input

{{ routes.account_url }}

Output

/account

routes.account_login_url

Returns the URL for the account login page.

Input

{{ routes.account_login_url }}

Output

/account/login

routes.account_logout_url

Returns the URL to log the customer out of their account.

Input

{{ routes.account_logout_url }}

Output

/account/logout

routes.account_register_url

Returns the URL for the account registration page.

Input

{{ routes.account_register_url }}

Output

/account/register

routes.account_addresses_url

Returns the URL for the page where the customer can manage the addresses associated with their account.

Input

{{ routes.account_addresses_url }}

Output

/account/addresses

routes.collections_url

Returns the URL for the collections page.

Input

{{ routes.collections_url }}

Output

/collections

routes.all_products_collection_url

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

Input

{{ routes.all_products_collection_url }}

Output

/collections/all

routes.search_url

Returns the search URL.

Input

{{ routes.search_url }}

Output

/search

routes.cart_url

Returns the cart URL.

Input

{{ routes.cart_url }}

Output

/cart

routes.cart_add_url

Returns the URL that accepts items to be added to a cart. You must specify at least one item using the item's variant.id or item.key. For more information, refer to the Ajax Cart API reference.

Input

{{ routes.cart_add_url }}

Output

/cart/add

routes.cart_change_url

Returns the URL that allows you to change the quantity of an item. You must specify the item's variant.id or line_item.key. For more information, refer to the Ajax Cart API reference.

Input

{{ routes.cart_change_url }}

Output

/cart/change

routes.cart_clear_url

Returns the URL that allows you to clear the cart.

Input

{{ routes.cart_clear_url }}

Output

/cart/clear

routes.product_recommendations_url

Returns the URL that serves product recommendations.

Input

{{ routes.product_recommendations_url }}

Output

/recommendations/products