How can I connect my Shopify app's Theme extension with stores using Shopify CLI and PHP?

447 Views Asked by At

How to create and use Shopify theme extension for Shopify Apps with PHP?

I have created a Shopify app and I want to use a Theme extension instead of a script tag. I create theme extensions using Shopify CLI. now I want to connect it with stores.

command

This is the screenshot of the folder that I created.

2

There are 2 best solutions below

1
On

If you navigate to your app settings from the Shopify partner account, you will find the settings for extensions. There you will see to Enable/Disable theme app extension.

2
On
                                                                                                                                                     Put a line of code in your extension block, push to your development store. Now enable previews in your App by clicking the link the CLI gives you, and then visit the store, theme, customizer. Now you can test if your extension loaded by enabling it in the customizer and seeing the code from your block, in the theme, where you put it. 

It is pretty easy to do. Shopify has ironed out most of the kinks, so I find it takes very few keystrokes to go from typing in my code editor, using the CLI and seeing the result live in a theme.

I suggest you play and follow the Shopify recipes to get to this point.