Theme Engine
Theme Engine is a cross-platform application that makes it easy to develop ShopWired themes in your local environment. Download Theme Engine and, after some minor configuration, you’ll be ready to start creating ShopWired themes locally.
Using Theme Engine will enable you to:
- Upload themes to multiple environments
- Watch for changes to theme files in your local environment and sync them automatically to a ShopWired theme
Theme Engine works on Windows, Linux, and macOS.
Installation
Installation
Install Theme Engine using the command shown below:
npm install -g https://s3-eu-west-1.amazonaws.com/shopwired-resources/shopwired-theme.tgz
NPM is a cross-platform command, but administrative permissions might be required on all platforms. Under Linux, sudo should be used, e.g.
sudo npm install -g https://s3-eu-west-1.amazonaws.com/shopwired-resources/shopwired-theme.tgz
Obtain your API keys
Obtain your API keys
To use Theme Engine, you need to authorise access using API authentication with your ShopWired account's API key and API secret.
.
Obtain your theme ID
Obtain your theme ID
Theme Engine uses a theme ID
to make changes from your local environment to the theme files stored in your ShopWired account. To obtain a theme ID:
- Navigate to the Installed themes page
- Select
edit code
for your theme - Inspect the URL, e.g.
https://admin.myshopwired.uk/themes/editor/133334
, the number at the end of the URL is the theme ID
Create a config file
Create a config file
Create a directory for your theme on your device and navigate to the directory.
Using your API credentials and theme ID in place of a, b, and c (respectively), run the following command:
shopwired-theme config --api-key a --api-secret b --theme-id c
Running the config command creates a config.json
file in the local directory. The config file can be edited if required.
{
"apiKey": "...",
"apiSecret": "...",
"themeId": ...
}
Download
Download
To download all of your theme files to the local directory:
shopwired-theme download
Upload
Upload
To upload theme files to your ShopWired account:
shopwired-theme upload
Specify the name of each file after the command, e.g.
shopwired-theme upload home.twig product.twig
Watch
Watch
The watch command tells Theme Engine to listen for changes to your theme in your local environment and automatically upload the added or modified files to your ShopWired account:
shopwired-theme watch
Remove
Remove
Use the remove command to remove theme files:
shopwired-theme remove
Specify the name of each file after the command, e.g.
shopwired-theme remove home.twig product.twig