Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am using Shopify 2.0 CLI for the first time, and have noticed that "shopify theme push" will overwrite settings_data.json, and reset (remove) any dynamic sections that the merchant has added to their store.
This seems dangerous, since pushing a theme might nuke a merchant's customisations.
Am I doing it wrong? Is there a safer way to push a theme?
On a related note, where does Shopify store section data? For instance if a merchant adds dynamic sections to their homepage where is that data stored, since it's not in settings_data.json?
Solved! Go to the solution
This is an accepted solution.
Hello,
Before making changes to an already set store, pull your theme, modify anything you want and then push. You can also duplicate the store for safety before doing any of these things
I am experiencing the same issue. It's really problematic as I'll customize a bunch of settings in the store --- but every time I run `shopify theme push` it resets them back to the default.
This is an accepted solution.
Hello,
Before making changes to an already set store, pull your theme, modify anything you want and then push. You can also duplicate the store for safety before doing any of these things
Thanks, pulling first works 🙂
I figured out that section customizations are stored in the relevant template's JSON file, in the "settings" key. Synchronising those files from remote > local is the step I was missing.
Before making changes to an already set store, pull your theme, modify anything you want and then push.
This is fine, just so long as whoever is working on the theme remembers to do so first. This approach, in Online Store 2.0, seems to be pretty high-risk, to me at least.
This is fine, just so long as whoever is working on the theme remembers to do so first. This approach, in Online Store 2.0, seems to be pretty high-risk, to me at least.
Agreed. I would prefer that Shopify CLI had an equivalent to Theme Kit's "watch" command, which watched for any changes made to your local files, and automatically pushed updates to your theme in the connected Shopify store. Instead of pushing the entire theme, it would push only the modified file.
Theme Kit's "deploy" command also accepted a single file name as a flag, so the developer could push just one file.
If either of those options were added to Shopify CLI it would eliminate - or at least dramatically reduce - the likelihood of accidentally overwriting data.
Shopify CLI 2.3.0 includes an --ignore option which partially addresses the issue described in this thread.
https://github.com/Shopify/shopify-cli/pull/1479
Ex.:
shopify theme push --ignore "config/*.json"
The ignore option is merged with any pattern defined in .shopifyignore
Yes but now there are other json files for the templates. It becomes tedious. I would appreciate a shortcut which ignores all "Customise" related things in one go. Or maybe we can do "**/*.json" as an argument?... regardless I would feel more confortable if we had a way to deal with conflicts instead of blindly overwrite everything. Because it means we need to ask the client to not touch anything after we pull.
`theme watch` is perfect. They just had to remove it.
Yes I have a similar issue and when you version your code with Git, it is even trickier. This mix of code and data feels dangerous.
The only problem with this method is what if my client makes changes while I'm editing the templates? I have overwritten my clients' changes several times now. I'd like someone to explain exactly the process of editing templates, styles, and js from a developer standpoint, while a client or editor is working on content. I really don't like the mixing of content + build in the new CLI.
Sadly I think the only solution for now is to completely ignore the 'templates' folder or adding to your .shopifyignore
shopify theme push --ignore "config/**/*.json" --ignore "templates/**/*.json"
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024