There are a few ways to setup a local copy of your Shopify theme:
There might be a few other ways, but I found the ruby way the most easy to work with.
In order to work locally on the Shopify theme files you will need a few things:
The first thing is to install the Ruby installer, use the latest version.
The installation process is straight forward, but it will ask you to add Ruby to the Windows Environment Global Path and you should click the checkbox and add it there, so that you don't have to manually do it so afterwards.
You should choose the correct version of the DevKit that goes with the Ruby installer you added.
The installation process is easy as well.
ruby dk.rb init
which should create a config.yml
in the filderconfig.yml
file you should see at the bottom - C:/Ruby23-x64
( depending where you installer your Ruby and what version is ) if it's not there you must add it manuallyruby dk.rb install
gem install json --platform=ruby
that will confirm that your Ruby installation is workingMore detailed instructions can be seen here as well: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
You will need to add the cacert.pem file to your window global variables.
Open your cmd and enter the following code: gem install shopify_theme
This should install the the Shopify theme gem that we will need.
If you went trough all of the above steps once, you won't be doing them any more.
Now comes that steps that you will have to do every time you start a new Shopify Project:
You must login to your Shopify store admin panel and go to the App screen -> Private app:
https://YOUR-STORE-NAME.myshopify.com/admin/apps/private
And click the button Create private app.
It will ask you for a title. ( enter what ever you like )
The important part is to change all of the permissions to Read and write
Once you change the permissions and save the App it will redirect you to a page from which you will get the API Key and Password for this App. ( you need those for the config file we will create below)
Go to a local folder where you like the theme files to be in and cmd inside.
Write the following command:
theme configure API-KEY PASSWORD DOMAIN ID
Where:
Once you run the above code it should create a file called config.yml where all the provided information will be present.
Now you should cmd ( in case you closed the console ) in the folder where the config.yml is and you write the following code: theme download
which should start downloading the files one by one.
Once you complete the download process you write theme watch
and every time you modify the downloaded files it will update the files in the Shopify store after 1-2 sec as well. This is true if you add files as well, but not when you delete files.
More detailed information for the Gem can be found here: https://github.com/Shopify/shopify_theme