Skip to content

wix-incubator/template-store-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIX Template Store

If you want to have your own template store, just follow these simple steps:

  1. Getting code
  2. Getting API wix.com keys
  3. Selecting your templates with prices, descriptions
  4. Publishing your site

Getting code

Get our sample code from GitHub. You need to have git client for your computer. To get our template store you need to do

$ git clone https://github.com/wix/template-store-example.git

in command line or select "git clone" from your GUI utility. This will fetch it to your hard disk drive. Remember folder where it was downloaded, so that you can edit templates later.

Getting keys

Now go to api.wix.com and signup to get the keys. You'll get a pair of very long strings called public and secret key. Don't reveal your secret key to anyone and better don't check it in VCS.

Next do whatever you want to customize your template store - HTML templates are in app/views, JS/CSS assets are in app/assets.

Selecting your templates

Go to http://api.wix.com and add your linked WIX.com account. Once you did it and if you have at least one site, you'll see new "Templates" link in navigation menu. There will be a list of templates taken from your WIX accounts. Specify descriptions and prices, make sure "Include?" checkboxes are enabled and click "Generate" to get your templates file. Copy this file in your config folder and commit it like that:

$ git commit -m "Templates.yml added" config/templates.yml
$ git push heroku master

Publishing your site

In case you are familiar with Rails you can just deploy like you want, it's just a Rails app. Otherwise we recommend to use Heroku.

  1. For this just register and follow their instructions.
  2. After email confirmation you have to install heroku toolbelt - command line utility to link your code with Heroku account. Do
$ heroku login

and enter your credentials.

  1. Next go to the folder with template store and do
$ heroku apps:create

inside.

Then once you changed templates and committed something just do

$ git push heroku master

to update/install your code on Heroku.

To populate your database with the list of selected template, you need to execute the following command:

$ RAILS_ENV=production rake db:seed

in case you use Heroku do this instead:

$ heroku run rake db:seed RAILS_ENV=production

Now execute this in console replacing YOUR_SECRET_KEY and YOUR_PUBLIC_KEY with your real keys from api.wix.com:

$ heroku config:add WIX_SECRET_KEY=_YOUR_SECRET_KEY_
$ heroku config:add WIX_PUBLIC_KEY=_YOUR_PUBLIC_KEY_

Same things should be done for setting your PayPal account:

$ heroku config:add PAYPAL_ACCOUNT=your_paypal_account@email.here
$ heroku config:add PAYPAL_SANDBOX=false

This will update your Heroku application and restart it, so that in a minute you should have working template store!

About

Wix Template Store Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors