Online Store 2.0 Multi-store Github Theme Setup

timd
Shopify Expert
121 6 74

I have a number of clients with multiple regional stores that share the same theme but have different settings_data.json files. This wasn't a problem with ThemeKit because we could exclude files in the config.yml file.

But as I begin to migrate stores to use the new Shopify Github and Online Store 2.0 functionality I'm not sure how to maintain a theme across multiple stores with different theme settings and json data.

Adding the templates/* to .gitignore removes the files from the theme on Shopify so I'm not sure if there is any alternative to retain json data files on the Shopify store theme, but have them untracked in the git repo

Replies 9 (9)

HiddeS_InStijl
Shopify Partner
3 0 2

We have the same issue. Do you have any updates on this?

timd
Shopify Expert
121 6 74

I haven't been able to find a solution yet and its a bit tricky even with Theme Kit because I need to add each .json template to the ignore list of each regional store. When its a client with 5+ regions, dev and production environments for each and a ton of json templates it becomes quite a long config file and a lot of keep on top of.

It would be great if there was a wildcard *.json ignore rule for Theme Kit

timd
Shopify Expert
121 6 74

I've found there is a wild card feature for Theme Kit: https://github.com/Shopify/themekit/issues/36

V1nk0
Shopify Partner
9 0 6

I have also tried to do this with the Shopify Github Integration, as I have a client with multiple stores (one for each sub-brand) using the exact same theme (but of course different configuration like logo, colours, fonts, etc.).

Unfortunately it seems impossible to have this set-up, as Shopify (event with settings_data.json in the .gitignore file) pushes the settings_data.json to the repository each time the configuration of one of the shops is changed. As this adds/changes the settings_data.json in the repository, this configuration is then applied to all stores using the repository (effectively giving all stores the configuration of the shop that was last changed).

Other than going back to ThemeKit, which enables to exclusion of the settings_data.json, I've found no solution and ended up creating one repository for each store so that I can use the GitHub-way. So I have multiple repositories with exactly the same files except for the settings_data.json 😞

I guess the Shopify Github Integration was never meant to maintain a theme that is in use by multiple stores.

alexsuarez
Shopify Partner
11 0 12

Well for that, you need an extra hand - you can use github with workflows. (1 repository in all stores with workflow configuration). For example: when you push or merge to master it will copy the settings json with a condition to push the settings json in a correct region. 

JohnBarry92
Shopify Partner
1 0 0

Did you end up sticking with Themekit rather than using the Shopify CLI with online store 2.0? We're in the exact same position where data used to be stored in settings_data.json in store 1.0 and we ignored that file in the themekit_ignores file. With data now been stored in the templates JSON object we're ignoring the entire templates directory in our .shopifyignore file to allow us to upload new features directly to each store. We wouldn't be able to store the template JSON in our git repo (we use bitbucket) due to the relative image paths in each region. A lot of our clients tend to duplicate the production theme, make theme amends and redeploy the new theme therefor content can be different a lot of the time. We track theme version, rather than concerning ourselves on content assigned to that theme. Any findings you've come across would be much appreciated 

Philip2
Shopify Partner
1 0 0

Did anyone come up with a good solution for this?

HiddeS_InStijl
Shopify Partner
3 0 2

I've not tested this out yet, but this seems like a solution: https://community.shopify.com/c/technical-q-a/multiple-stores-using-same-github-branch/m-p/1607101/h...

 

It requires some extra work, but I think this should work.

BenjaminAntoni
Shopify Partner
17 0 4

FOUND A SOLUTION!

I've been trying to make this work for days on end, until I found this custom GitHub action built exactly for this:
https://github.com/Jamiemccleave/shopify-multi-store-deployer

Wish it was more known!