0
votes

I am new to shopify and just created one shopify development account, created one app. I have provided option for each user to install my app using their shopify shop name. So how can I include one of my javascript file(customized in my app) in their shopify page? Like I want to load my javascript file in their shopify page (this js file is for loading one popup for subscription). Do there any shopify api for loading this specific js file from my app to their shop page?

I used the following link for reference,

https://github.com/cmcdonaldca/ohShopify.php

1

1 Answers

0
votes

You can use the ScriptTag resource: https://help.shopify.com/api/reference/scripttag

This is from the Shopify website:

If you need to add anything to a storefront use JavaScript. Don't edit a theme's files. Add your JavaScript using a ScriptTag resource. When your app is uninstalled, your Javascript will no longer be used by the shop automatically, and that is the beauty of using a ScriptTag resource. The merchant won't need to edit his theme to bring it back to the way it was before your app's installation.