From script tags to Online Store 2.0

From script tags to Online Store 2.0

AppdevRobin
Shopify Partner
3 0 1

I have just completed an app loading in a simple js script to trigger a popup based on the page / timers / exit intent.

 

As the popup is UX related, the app reviewer demands I load the script using Online Store 2.0, without any instructions how to do this. The only thing I can find is building an entire wrapper app using cli 3.0 that does exactly the same as my php app. Is this assumption correct?

 

Simply put: Does someone have a step-by-step instruction how to go from script tags to something Online Store 2.0 that will be approved for an external (php) app.

 

Replies 4 (4)

EcomGraduates
Shopify Partner
627 49 88

Hello there  

 

To integrate an external PHP app with Shopify's Online Store 2.0, you need to create a new Script Tag, add it to your theme and create a PHP script. Make sure the script is hosted on a server that is accessible from your Shopify store, and verify that the external app is working as expected. Also, make sure to use scripts from trusted sources and review the code before adding it to your store, Shopify will review and approve your script before it's made live.

 

  1. Create a new Script Tag:
  • Go to the Shopify admin panel and navigate to the "Apps" section.
  • Click on the "Manage private apps" button.
  • Click on the "Create a new private app" button.
  • Give your app a name and a contact email address.
  • Under "Script tags," select the "Online store" option.
  • Click on the "Save" button.
  1. Add the script tag to your theme:
  • Go to the Shopify admin panel and navigate to the "Themes" section.
  • Click on the "Actions" button next to the theme you want to edit.
  • Click on the "Edit code" button.
  • In the "Layout" folder, open the "theme.liquid" file.
  • Scroll to the bottom of the file and add the following code:

 

 

  <script src="[SCRIPT_TAG_URL]"></script>

 

 

Replace [SCRIPT_TAG_URL] with the actual Script Tag URL provided by Shopify.

  • Click on the "Save" button.
  1. Create the PHP script:
  • Create a new PHP file with the code you want to use in your external app.
  • Make sure the PHP script is hosted on a server that is accessible from your Shopify store.
  1. Test the integration:
  • Go to your Shopify store and verify that the external app is working as expected.

 

 

 


If this fixed your issue, likes and accepting as a solution are highly appreciated.

Build an online presence with our custom built Shopify Theme EcomifyTheme



AppdevRobin
Shopify Partner
3 0 1

I am sorry, I meant this question as app dev, to publish my app online. This means I have no acces to individual stores. I need to do "something" with my app to make it compatible with online store 2.0, and outside the CLI tutorial I cannot find any information how to do this.

shovon1919
Shopify Partner
1 0 0

Same question, I'm stuck too.

AppdevRobin
Shopify Partner
3 0 1

I finally got it figured out afther thinking "okay, Ill make a new App then". With Shopify CLI you can actually update your existing App configuration and upload all files. You do not have to change anything in your app, just run the CLI when you want to update the configuration and select your App. But you will also want to detect if your App-files are installed, this takes an extra manual step for the customer. You can detect this (in your own backend) by loading all active theme files of the customer through the API and check if your app-files are listed.