Initially, I was overwhelmed by creating a custom theme / modifying the existing theme in the Shopify project. I had spent hours wondering if it was the best practice to change the .liquid file directly from Shopify. If you are in a similar situation, it is normal to feel in the initial stage.
I would like to share a few insights with you that will make your development process smooth.
If you are not aware of Shopify CLI, you are missing one of the best features on Shopify. It helps you to develop the theme locally without affecting the existing project. Also, you can back up the existing projects, so that you can revert the changes.
Link for Installing Shopify CLI
In order to verify if CLI is properly set up, you could use the following command in the terminal.
> shopify version
You need to tell the Shopify CLI which store you are connecting to, so that you can modify the files.
> shopify auth login
Use the following command to logout
> shopify auth logout
If it is the first time, use the following command
> shopify theme pull --store example.myshopify.com
Always create a duplicate theme so that the live website will not break during the development.
It is recommended to use git to track the changes.
> shopify theme push
> shopify theme push --theme 15500000000
> shopify theme push --unpublished
> shopify theme dev --theme 15500000000 --theme-editor-sync
You can view / update the changes from
> 127.0.0.1:9292