I have develop a Shopify theme I want when someone installs my theme on their store how can I get their shop URL. Please leu us know how can i do it
Hello there
If you’re developing a Shopify theme and want to get the store URL of the store where your theme is installed, you can use the {{ shop.url }} Liquid object.
Here’s an example of how to use it:
- In your theme files, create a new file called
example.liquid. - In the
example.liquidfile, add the following code:
{% capture shop_url %}{{ shop.url }}{% endcapture %}
The URL of this store is: {{ shop_url }}
- Save the
example.liquidfile and upload your theme to the Shopify App Store. - When a merchant installs your theme and previews it, they should see the URL of their store displayed on the preview page.