Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
363 stars 107 forks source link

Theme App Extension Support with kyon147 #259

Closed nandpalmohit closed 9 months ago

nandpalmohit commented 9 months ago

Shopify Theme Extension

As of now Shopify with version 2023-04 or later is not supported (deprecated) as Shopify restricts the theme access to do the changes. Instead, Shopify provides to use of Theme App Extension or Theme embed codes to add liquid sections or add blocks in the Shopify theme.

My question is any possibility of doing this operation with this package and if yes, then how we can perform this operation with the kyon147 package?

matthewhaworth commented 9 months ago

Hello @nandpalmohit,

The way I went about this was to basically add the following to your package.json

        "shopify": "shopify",
        "shopify-build": "shopify app build",
        "shopify-dev": "shopify app dev",

under 'scripts'. Then, you can run npm run shopify app generate extension which will create an extensions folder in your laravel project root. From there, you can just carry on as per any Shopify tutorial.

Kyon147 commented 9 months ago

As @matthewhaworth mentions you can use the Shopify cli. The theme extension is agnostic to the package - you could host it anywhere but inside the project makes the more sense.

I have an app embed that lives in the root of my laravel-php project and just use the Shopify cli to create a new version and push it up.