In the following videos we'll create a Commerce.js powered store with Svelte, and Sapper.
We will fetch products, and their categories, along with creating pages for each, and an index page to show everything.
Let's get setup with the initial Sapper + Svelte boilerplate, and customize it to our needs.
In this video we'll install and setup Commerce.js — You'll need an account to continue, or you can continue with the demo public API key: pk_184625ed86f36703d7d233bcf6d519a4f9398f20048ec
.
In this video we'll use the async preload
function to fetch our merchant information, categories, and products for index.svelte
.
In this video we'll go ahead and create the products index page at routes/products/index.svelte
.
In this video we'll create the index page for our categories at routes/categories/index.svelte
.
In this video we'll handle creating pages for all our categories using the [slug]
.
Just like we did for the category pages, let's handle creating pages for each of our products using the [permalink]
.