Custom code
Upload your own HTML, CSS and JavaScript and run it as your storefront. SellSpace keeps doing the products, cart and checkout.
Custom Code is a paid plugin: EUR 9.99 per month on every plan. Get it in Marketplace > Plugins > Custom Code, or from the Custom Code box on the Themes page of your dashboard. This page is public so you can read how it works before you buy.
How to start
- Open Themes in your dashboard and activate Custom Code for your shop (€9.99 per month, on every plan).
- Drop your site as a zip on the Custom code block. Each file is checked; errors are listed per file.
- Click Preview. It opens a private page with your real products. Buyers do not see it.
- Click Publish. Back to standard theme is always there if you change your mind.
If the plugin ends or a payment fails for good, your shop goes back to its standard theme and keeps selling. Your code stays stored and comes back when you activate the plugin again.
You can also pay for Custom Code with crypto (when SellSpace has it switched on): Pay 1 month with crypto in the Custom Code box. Crypto pays for 1 month. It does not renew. Pay again next month. When the month ends your shop shows its standard theme again and your code stays stored. See Paying for SellSpace plugins with crypto.
Zip layout
site.zip
index.html required: home page
products.html optional: all products, category and group pages
product.html optional: one product
style.css
app.js
images/logo.png
fonts/site.woff2
A zip of a single folder works too. Without products.html or product.html, those pages open index.html and you read SellSpace.route to know what to show.
| Limit | Value |
|---|---|
| Zip size | 20 MB |
| Unpacked | 60 MB, 15 MB per file |
| Files | 400 |
| Allowed types | html, htm, css, js, mjs, json, txt, png, jpg, jpeg, gif, webp, avif, ico, svg, woff, woff2, ttf, otf |
| Names | Letters, digits, spaces and . _ - ( ) @ + ~. No hidden files, symlinks or zips inside the zip. |
Starter template
Do not start from a blank page. The starter template is a complete, good-looking site (dark theme, blue accent, works on phones) that already uses every SellSpace function, so nothing gets forgotten. Download it from the Custom Code box on the Themes page once the plugin is active (Download starter template, a file called sellspace-custom-code-starter.zip). This page only explains it: the download is for shops with the active plugin.
| File | What it is |
|---|---|
index.html | Home: hero, featured products, categories, reviews, payment methods, social links. |
products.html | All products, category pages and group pages, with category filter and sorting. |
product.html | One product: gallery, option buttons on top of the data-ss-variants select, quantity buttons, price, Add to cart, Buy now, stock, reviews of that product. |
help.html | Cart, checkout, account, support and legal pages in one place. |
style.css, app.js, images/, README.txt | Colors in variables at the top, shared header and footer plus commented SellSpace hooks, placeholder logo and product image, and a short guide. |
How to use it: unzip, change colors in style.css and texts in the html files, zip the contents again, drop the zip on the Custom Code box, click Preview, then Publish.
Checklist, did you add all of these?
- Home, Products (also used for categories and groups) and Product pages
- A cart button on every page (
data-ss-cart) and a checkout button (data-ss-checkout) - An account link (
data-ss-nav="account") and a support link (data-ss-nav="support") - Legal links (
data-ss-nav="legal"withdata-ss-ref): publish your Terms, Privacy and Refund pages in the dashboard first - A friendly message for products, categories and addresses that do not exist
A small working example
Save this as index.html, zip it, upload it. It lists your products and sells them.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>My shop</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1 data-ss-shop="name"></h1>
<button data-ss-cart>Cart (<span data-ss-cart-count>0</span>)</button>
</header>
<main data-ss-products>
<template>
<article>
<img data-ss-field="image" alt="">
<h2 data-ss-field="name"></h2>
<p data-ss-field="price"></p>
<button data-ss-add>Add to cart</button>
</article>
</template>
</main>
<button data-ss-checkout>Checkout</button>
</body>
</html>
Data attributes
The SDK is added to every HTML file for you. These attributes are filled in when the shop data arrives. A container with a <template> gets one copy per item; without one it gets a plain default.
| Attribute | What it does |
|---|---|
data-ss-products | Lists products. Optional: data-ss-category="slug", data-ss-limit="8". Follows the category or group page by itself. |
data-ss-product | One product block. Empty: the product of this page. Or a product id or slug. |
data-ss-field | Inside a product: name, price, description, image, category, stock. |
data-ss-add="12" | Add to cart. Empty inside a product block: that product. Optional data-ss-qty, data-ss-variant. |
data-ss-buy="12" | Buy now: goes straight to checkout with this item. |
<select data-ss-variants> | Options of the product (one <option> per variant, the variant id as value). Add and Buy use the chosen one of the select in the same product block, wherever your buttons sit inside it. The price in data-ss-field="price" follows the choice. The select works hidden too (display:none or clipped): to build your own buttons or pills, set select.value to the variant's value and dispatch a change event. A product with several options needs one chosen, or Add and Buy show "Choose an option first". |
<a href="https://..."> | A normal link to another site (YouTube, TikTok, X, Discord, Instagram, GitHub ...). It opens in a new tab, whatever target says, and only after a click by the buyer. Only https:// addresses with a normal public name work: no http://, IP addresses, localhost, user:password in the address or custom ports. Links between your own files, data-ss-nav and the other attributes keep working as before. |
<input data-ss-quantity> | Quantity for Add and Buy in the same block. Set its value from your own + and - buttons: typing does not reach it. |
data-ss-link | Inside a product: opens that product's page. |
data-ss-cart | Opens the cart. data-ss-cart-count shows the number of items. |
data-ss-checkout | Opens the SellSpace checkout. |
data-ss-nav="products" | Goes to home, products, cart, checkout, account, support, or with data-ss-ref: product, category, group, legal. |
data-ss-shop | name, description or logo of the shop. |
data-ss-categories | Lists categories (data-ss-field="name", "image"). |
data-ss-payment-methods | Lists the shop's payment methods by name and icon. |
data-ss-reviews | Lists reviews (data-ss-field="rating", "message", "name"). |
A site without any of these hooks and without the SDK cannot sell. The upload warns you and you can still publish it.
The SDK
SellSpace.ready(function () {
document.title = SellSpace.shop.name;
SellSpace.on('cart', function (items) { console.log(items.length + ' lines in the cart'); });
var first = SellSpace.products()[0];
if (first) document.querySelector('#add').onclick = function () { SellSpace.cart.add(first.id, { qty: 1 }); };
});
| Call | Result |
|---|---|
SellSpace.ready(fn) | Runs fn when the shop data is there. |
SellSpace.shop, .route, .preview | Name, description, currency, logo, colours; this page; whether this is a preview. |
.products(), .product(idOrSlug) | Public products: name, price, images, variants, stock. |
.categories(), .groups(), .paymentMethods(), .legal() | Public lists. |
.reviews({ product_id }) | Promise of a summary and reviews. |
.cart.get(), .add(id, { variant, qty }), .remove(id, { variant }), .setQty(id, qty, { variant }), .open() | The cart. The SellSpace page does the work and shows the notice. |
.checkout.start([id, { variant, qty }]) | Opens the SellSpace checkout. Needs a click by the buyer. |
.navigate(page, ref) | Same pages as data-ss-nav. Needs a click by the buyer. |
.on('cart', fn), .money(n) | Cart changes; a price in the shop's currency. |
What your code cannot do
Your site runs in a locked frame on a separate domain, around which SellSpace shows the page. That keeps buyers and you safe, and it means:
- No
fetch, WebSocket or other network calls, and no forms that send anything. Everything goes through the SDK. - No scripts, styles, images or fonts from other sites. Put them in the zip.
<link>works forstylesheetandicononly. No video in this version. Product images must be uploaded to SellSpace; product images linked from another site do not show. - No
<iframe>,document.writeor WebRTC, no cookies,localStorage,window.openpop-ups, alert boxes or downloads. Your site never navigates away by itself: links between files of your zip work,data-ss-navgoes to shop pages, and a normal<a href="https://...">link to another site (social media, Discord, GitHub ...) opens in a new tab after a buyer's click. Onlyhttpsto a public name;http, IP addresses,localhost, user:password in the address and custom ports are refused. - No access to buyer data, orders, customers, settings or other shops. You get the same public data a visitor already sees.
- No typing. The page around your site takes the keyboard back whenever focus enters your site, so text fields inside it normally get no keystrokes. Build with buttons and links. Build choices with buttons or links; a hidden
select data-ss-variants(see above) carries the chosen option. - Cart, checkout, payment and sign-in are always SellSpace screens. Asking buyers for card details, passwords or wallet details in your own design breaks the Acceptable Use Policy and gets your code switched off.
SellSpace keeps a small bar under your site with the cart and Report this shop. Search engines get your shop name, descriptions and product list as plain text from SellSpace.
SellSpace