Get current url of any page

Here's a quick and easy way to get any Shopify url in your store.

{% assign current_url = canonical_url %}
{% assign current_url = current_url | replace: "https://storeurl.myshopify.com", "" %}
{% assign current_url = current_url | replace: shop.secure_url, "" %}
Joe Pichardo | Shopify Developer

About Joe Pichardo

Joe Pichardo is a Shopify Developer creating themes and apps to help other programmers succeed on the ecommerce platform.

Having trouble? Ask for help.