# OpenCart SvelteKit Storefront — Svelte Commerce Connector

> Svelte Commerce on OpenCart: 9 of 43 services wired. Catalogue and search are not, so it is not usable for a store yet. What works, and why.

- Canonical: https://kitcommerce.store/svelte-commerce/backends/opencart/
- Last updated: 2026-09-25

---

Svelte Commerce × OpenCart

## Svelte Commerce on OpenCart

OpenCart is the most constrained backend of the 26. Its core API is for order management, not a storefront: ten controllers, and none for products, categories or search. At 9 of 43, the connector is not usable for a store yet.

- **9/43** services wired
- **@misiki/opencart-connector** 0.5.0
- **Cart** wired
- **Checkout** wired
- **Sign-in (auth)** no endpoint on the platform

### What works on OpenCart today

Not usable for a store yet. With catalogue and search unwired, the storefront has no products to show, and none of the ways it places an order is implemented either. OpenCart core ships exactly ten API controllers — cart, coupon, currency, customer, login, order, payment, reward, shipping, voucher — so 9 of 43 is the honest ceiling for that API, not a to-do list.

#### Cart

Wired: issues a real request to OpenCart.

#### Checkout

Wired: issues a real request to OpenCart.

#### Sign-in (auth)

No endpoint on OpenCart: it throws NotSupportedError rather than pretend.

**Known gaps:** `catalogue`, `search`, `auth`, `address`, `user`, `profile`, `coupon`, `page`, `wishlist`, `vendor` — each is explained under Limitations below.

9 of 43 services wired, read from [CONNECTORS.md](https://github.com/itswadesh/svelte-commerce/blob/main/docs/CONNECTORS.md) on 21 September 2026, where the package version is recorded too; npm may carry a newer patch. Coverage is traced by a script in the Svelte Commerce repository: a service counts as wired only if it transitively issues an HTTP request, or delegates to one that does. It is not hand-asserted. Some services are Litekart-native concepts with no equivalent elsewhere (reels, deals, chat, gallery, popularity, demo-request, feedback, plugins, banner). They stay documented placeholders on every connector and are excluded from known gaps.

### Quick start

From nothing to a Svelte Commerce storefront reading OpenCart. You need Node.js and a OpenCart to point it at; the storefront holds no data of its own.

Clone it, choose the connector, point it at OpenCart

```
# 1 — get the storefront
git clone https://github.com/itswadesh/svelte-commerce
cd svelte-commerce

# 2 — one connector at a time: remove the two the storefront ships with, add this one
npm uninstall @misiki/litekart-connector @misiki/vendure-connector
npm i @misiki/opencart-connector

# 3 — point it at your OpenCart store
echo PUBLIC_OPENCART_API_URL=https://your-store.example.com >> .env
echo PUBLIC_OPENCART_API_KEY=... >> .env
echo PUBLIC_OPENCART_API_SECRET=... >> .env

# 4 — run it
npm run dev
```

The guide removes only `@misiki/litekart-connector`. A fresh clone’s `package.json` also lists `@misiki/vendure-connector`, and with two connectors installed and neither of them Litekart’s, the build stops and asks for `PUBLIC_CONNECTOR` — so this removes both.

### Environment variables

*What Svelte Commerce reads to reach OpenCart*

| Variable | Required | What it does |
| --- | --- | --- |
| `PUBLIC_OPENCART_API_URL` | Yes | Your OpenCart store’s URL. Boot fails, naming this variable, if it is missing. |
| `PUBLIC_OPENCART_API_KEY` | No | The API user’s username, from System › Users › API in the OpenCart admin. See the limitations. |
| `PUBLIC_OPENCART_API_SECRET` | No | That API user’s key. |
| `PUBLIC_OPENCART_ACCESS_TOKEN` | No | An API session token to use instead of logging in. It belongs to one shopper’s cart session, and the connector never swaps it for another. |
| `PUBLIC_CONNECTOR` | No | Only when more than one connector is installed: `@misiki/opencart-connector` names the one this build runs on. |

`init.ts` hands the connector every `PUBLIC_OPENCART_*` variable that is set, camel-cased. The guide also lists `PUBLIC_OPENCART_ACCESS_KEY`, `PUBLIC_OPENCART_STORE_ID` and `PUBLIC_OPENCART_CHANNEL_ID`; the connector’s source does not read them.

Every variable here begins `PUBLIC_`, and SvelteKit sends `PUBLIC_` variables to the browser: treat each value you set as published.

### What to set up on OpenCart

- Create an API user under System › Users › API in the OpenCart admin; its username and key go in `PUBLIC_OPENCART_API_KEY` and `PUBLIC_OPENCART_API_SECRET`.
- Let the storefront’s origin make cross-origin requests to OpenCart (CORS): in production the browser calls `PUBLIC_OPENCART_API_URL` directly, not only the server.

### How the integration works

OpenCart core’s API (`route=api/...`) is for order management, not for a storefront catalogue. The connector wires what it can: the cart, shipping and payment addresses and methods on the API session, and shipping rates. There is no product, category or search controller to call.

`api/order/info` has no ownership check at all — any API caller can read any order — so the connector quarantines it behind an admin-only method that a shopper-facing call can never reach.

Installing the package is the whole switch. `vite.config.ts` resolves whichever `@misiki/*-connector` is installed, and `src/lib/core/connectors/init.ts` hands it every `PUBLIC_OPENCART_*` variable that is set, camel-cased, at boot — in the server hook for server rendering and in the client hook for the browser, which must reach the same URL in production.

There is no Litekart API behind the storefront here, so store identity — name, logo, currency, menus, plugin toggles, theme colours — comes from `src/lib/core/connectors/default-store.json` merged under the default export of `kitcommerce.config.ts`. Until you override it, the store is called “Test”. Any Litekart REST path the connector still inherits is answered from that local data, or resolved empty, rather than requested.

### Limitations

- Not usable for a store yet: without the catalogue and search, there is nothing for a shopper to browse.
- No order can be placed. Placing an order (`route=api/order/add`) needs a customer, both addresses and shipping and payment methods on the API session, which the storefront’s checkout calls cannot supply; every way the storefront places an order is unsupported.
- Catalogue: not wired — OpenCart core has no product or category API controller, so the storefront has no products to list.
- Search: not wired — there is no search controller either.
- Sign-in (auth): throws `NotSupportedError` — OpenCart has no core endpoint that returns a shopper session, and a stub that signed anyone in for any password would be an auth bypass, not a placeholder.
- Saved addresses: not wired.
- User accounts: not wired.
- Profile: not wired.
- Coupons: not wired.
- CMS pages: not wired — legal and CMS pages render their layout with empty content.
- Wishlist: not wired.
- Vendors: not wired.
- Pages that depend on a service that is not wired render their empty state rather than failing.
- The API username and key come from `PUBLIC_OPENCART_API_KEY` and `PUBLIC_OPENCART_API_SECRET`. SvelteKit sends `PUBLIC_` variables to the browser, so every visitor can read them and use that API user’s order-management access.
- Homepage sections other than the live product list come from the active theme’s static content — the standing rule for themes.
- The Conversational Shopping assistant is Litekart-only; its widget stays hidden when another connector is active.

### Troubleshooting

*Errors you may meet running Svelte Commerce on OpenCart, and what fixes them*

| When you see | What to do |
| --- | --- |
| Boot fails with “the opencart connector is active but PUBLIC_OPENCART_API_URL is not set” | Add `PUBLIC_OPENCART_API_URL` to `.env`. A production Node build and Docker read `PUBLIC_*` from the process environment rather than `.env`, so set it on your deploy platform too. |
| The build stops with “Several commerce connectors are installed … Set PUBLIC_CONNECTOR to pick one” | More than one `@misiki/*-connector` is in `package.json` and none is Litekart’s. Uninstall the ones you do not run — a fresh clone also lists `@misiki/vendure-connector` — or set `PUBLIC_CONNECTOR='@misiki/opencart-connector'`. |
| Boot fails with “PUBLIC\_…\_API_URL is set, but it configures a different backend than the one this build runs on” | Another backend’s variable is still set, usually left over from the one you switched from. Remove it, or install that backend’s connector. `PUBLIC_LITEKART_API_URL` is exempt: it only points the dev proxy. |
| The store is called “Test”, or shows the wrong name and logo | Store identity is static on this backend. Set `name`, `logo`, `currencyCode` and the rest in the default export of `kitcommerce.config.ts`; `src/lib/core/connectors/default-store.json` lists every field. |
| `[opencart] no native implementation for get /api/...` in the console | The connector’s REST guard caught a path inherited from Litekart and answered it empty instead of requesting it. Each path is reported once. Harmless if OpenCart has no such feature; if it has one, the fix belongs in the connector’s matching service. |
| `http proxy error: api/... ECONNREFUSED` in dev | A Litekart REST path was requested from outside the connector, so its guard never saw it. Vite proxies `/api` to `PUBLIC_LITEKART_API_URL`, or to `localhost:7000`. |
| The build fails on `@misiki/litekart-connector` | `@misiki/kitcommerce-core` declares it as a peer, and `vite.config.ts` redirects that specifier to whichever connector is installed. Make sure exactly one `@misiki/*-connector` is listed in `package.json`. |

### Before you rely on it

#### The one caveat that matters

Read this before choosing

Every connector was written by reading its platform’s authoritative source — an OpenAPI spec, a RAML file, a router registration or the controller source — rather than by running against a store. **No connector has been exercised against a live production instance of its platform.**

An open question for OpenCart’s maintainers: Is a storefront REST surface planned for OpenCart 4, or is a custom extension the expected route?

[Offer a sandbox or a correction](https://github.com/itswadesh/svelte-commerce/discussions/new/choose)

FAQ

### Questions about Svelte Commerce on OpenCart

**Can I run an OpenCart store on Svelte Commerce today?**

No. The connector has no catalogue or search to show — OpenCart core has no API for them — and the storefront cannot place an order through it. At 9 of 43 services, it is not usable for a store yet.

**How do I switch Svelte Commerce to OpenCart?**

Remove the connectors the storefront ships with, install @misiki/opencart-connector, set PUBLIC_OPENCART_API_URL in .env and start the dev server. vite.config.ts resolves whichever connector is installed, so no file in the storefront changes.

**Why is OpenCart only at 9 of 43?**

Because that is what OpenCart core’s API offers. It ships exactly ten API controllers — cart, coupon, currency, customer, login, order, payment, reward, shipping and voucher — for order management, with none for products, categories or search. The Svelte Commerce maintainers have asked OpenCart’s maintainers whether a storefront REST API is planned for OpenCart 4.

**Has the OpenCart connector been run against a real OpenCart store?**

Not against a live production instance — no Svelte Commerce connector has been. It was written by reading OpenCart’s authoritative API source, and the Svelte Commerce maintainers ask OpenCart’s own maintainers for a sandbox to run it against.

### Sources

This page summarises OPENCART.md in the Svelte Commerce repository and the OpenCart connector’s source, read on 25 September 2026, and the coverage in CONNECTORS.md, read on 21 September 2026. Where they disagree with this page, they are right and this page is out of date. OpenCart is a trademark of its owner, named here only to describe compatibility; no endorsement or affiliation is implied — see [trademarks](https://kitcommerce.store/about/#trademarks).

- [OPENCART.md — the full guide for OpenCart](https://github.com/itswadesh/svelte-commerce/blob/main/docs/OPENCART.md)
- [CONNECTORS.md — coverage for all 26 connectors](https://github.com/itswadesh/svelte-commerce/blob/main/docs/CONNECTORS.md)
- [@misiki/opencart-connector on npm](https://www.npmjs.com/package/@misiki/opencart-connector)
- [OpenCart](https://www.opencart.com)

### Read the whole guide

The storefront is the same on every backend; the connector is what changes. OPENCART.md has the OpenCart setup in full, beside the connector’s source.

[The OpenCart guide on GitHub](https://github.com/itswadesh/svelte-commerce/blob/main/docs/OPENCART.md) · [All 26 backends](https://kitcommerce.store/svelte-commerce/backends/) · [KitCommerce vs OpenCart](https://kitcommerce.store/compare/kitcommerce-vs-opencart/)
