Skip to main content

routes

Allows you to generate standard URLs for the storefront.

Using the routes object instead of hardcoding URLs helps ensure that your theme supports multiple languages, as well as any possible changes in URL format.

Properties

Anchor to
account_addresses_url

The account addresses page URL. Redirects to new customer accounts when enabled.

Anchor to
account_login_url

The account login page URL. Redirects to new customer accounts when enabled.

Anchor to
account_logout_url

The URL to log a customer out of their account. Redirects to new customer accounts when enabled.

Anchor to
account_recover_url

The password recovery page URL. Redirects to new customer accounts when enabled.

Anchor to
account_register_url
Anchor to
account_url

The account page URL. Redirects to new customer accounts when enabled.

Anchor to
all_products_collection_url

The all-products collection page URL.

The all-products collection is automatically generated by Shopify and contains all products in the store.

Anchor to
cart_add_url

The URL for the /cart/add Cart API endpoint.

Anchor to
cart_change_url
Anchor to
cart_clear_url
Anchor to
cart_update_url

The cart page URL.

Anchor to
collections_url
Anchor to
predictive_search_url
Tip

To learn about how to support predictive search in your theme, refer to Add predictive search to your theme.

Anchor to
product_recommendations_url

The index (home page) URL.

The search page URL.

Anchor to
storefront_login_url

New customer accounts login page. Redirects to the storefront page the customer was on before visiting the login page.

{
"account_addresses_url": "/account/addresses",
"account_login_url": "/account/login",
"account_logout_url": "/account/logout",
"account_recover_url": "/account/recover",
"account_register_url": "/account/register",
"account_url": "/account",
"all_products_collection_url": "/collections/all",
"cart_add_url": "/cart/add",
"cart_change_url": "/cart/change",
"cart_clear_url": "/cart/clear",
"cart_update_url": "/cart/update",
"cart_url": "/cart",
"collections_url": "/collections",
"predictive_search_url": "/search/suggest",
"product_recommendations_url": "/recommendations/products",
"root_url": "/",
"search_url": "/search",
"storefront_login_url": "/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"
}
Was this section helpful?