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.

The routes object has the following attributes:

routes.root_url

Returns the root URL.

routes.account_url

Returns the account URL.

routes.account_login_url

Returns the account login URL.

routes.account_logout_url

Returns the account logout URL.

routes.account_recover_url

Returns the account recover URL.

routes.account_register_url

Returns the account register URL.

routes.account_addresses_url

Returns the account addresses URL.

routes.all_products_collection_url

Returns the URL that points to the collection for all products.

routes.search_url

Returns the search URL.

routes.cart_url

Returns the cart URL.

routes.cart_add_url

Returns the URL that accepts items to be added to a cart.

routes.cart_change_url

Returns the URL that allows a cart to be changed.

routes.cart_clear_url

Returns the URL that will clear the cart.

Ready to start selling with Shopify?

Try it free