Svelte Commerce × PrestaShop
Svelte Commerce on PrestaShop
The PrestaShop connector works through the webservice API, and that API is the constraint: it has no customer login and no cart-to-order checkout. Browsing and the cart are wired; placing an order is not possible through it.
- 24/43 services wired
- @misiki/prestashop-connector 0.4.0
- Cart wired
- Checkout wired
- Sign-in (auth) no endpoint on the platform
What works on PrestaShop today
Shoppers can browse and fill a cart, but cannot sign in or place an order. Checkout counts as wired because the list of carriers comes from PrestaShop; the webservice API has no checkout or payment surface — placing an order is something only a front-office payment module can do — so every way the storefront places an order, cash on delivery included, is a placeholder.
Cart
Wired: issues a real request to PrestaShop.
Checkout
Wired: issues a real request to PrestaShop.
Sign-in (auth)
No endpoint on PrestaShop: it throws NotSupportedError rather than pretend.
Known gaps: auth, review, wishlist, payment-method — each is explained under Limitations below.
24 of 43 services wired, read from CONNECTORS.md on , 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 PrestaShop. You need Node.js and a PrestaShop to point it at; the storefront holds no data of its own.
Clone it, choose the connector, point it at PrestaShop
# 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/prestashop-connector
# 3 — point it at your PrestaShop shop
echo PUBLIC_PRESTASHOP_API_URL=https://your-store.example.com >> .env
echo PUBLIC_PRESTASHOP_API_KEY=... >> .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
| Variable | Required | What it does |
|---|---|---|
PUBLIC_PRESTASHOP_API_URL | Yes | Your PrestaShop shop’s URL. Boot fails, naming this variable, if it is missing. |
PUBLIC_PRESTASHOP_API_KEY | No | The webservice key from Advanced Parameters › Webservice. Every call needs it. See the limitations. |
PUBLIC_PRESTASHOP_LANGUAGE_ID | No | The shop’s language ID, sent as language=<id> so translatable fields come back as plain values rather than per-language arrays. |
PUBLIC_PRESTASHOP_SHOP_ID | No | Multistore shop ID (id_shop). Falls back to PUBLIC_PRESTASHOP_STORE_ID when unset. |
PUBLIC_PRESTASHOP_SHOP_GROUP_ID | No | Multistore shop group ID (id_group_shop). |
PUBLIC_PRESTASHOP_STORE_ID | No | Read as the shop ID when PUBLIC_PRESTASHOP_SHOP_ID is unset. |
PUBLIC_CONNECTOR | No | Only when more than one connector is installed: @misiki/prestashop-connector names the one this build runs on. |
init.ts hands the connector every PUBLIC_PRESTASHOP_* variable that is set, camel-cased. The guide also lists PUBLIC_PRESTASHOP_API_SECRET, PUBLIC_PRESTASHOP_ACCESS_TOKEN, PUBLIC_PRESTASHOP_ACCESS_KEY and PUBLIC_PRESTASHOP_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 PrestaShop
- Enable the webservice and create a key under Advanced Parameters › Webservice, with access to the resources the storefront reads — and read the limitations first.
- Let the storefront’s origin make cross-origin requests to PrestaShop (CORS): in production the browser calls
PUBLIC_PRESTASHOP_API_URLdirectly, not only the server.
How the integration works
The webservice API is PrestaShop’s back-office API, not a storefront one: it has no customer login and no cart-to-order flow. The connector reads the catalogue and manages carts through it, and lists the shop’s active carriers as shipping options — without prices, because PrestaShop computes those outside the webservice.
Writes need care: translatable fields must be sent with <language> children, and echoing a display=full read straight back silently blanks them — a bug the connector hit and fixed.
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_PRESTASHOP_* 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
- The storefront cannot place an order. The webservice API has no checkout and no payment resource; placing an order is
PaymentModule::validateOrder(), which only a front-office payment module can call. So cash on delivery, Razorpay, Stripe and every other way the storefront places an order are placeholders on PrestaShop. - Sign-in (auth): throws
NotSupportedError— PrestaShop 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. - Reviews: not wired.
- Wishlist: not wired.
- Payment-method listing: not wired.
- Pages that depend on a service that is not wired render their empty state rather than failing.
- Shipping options come without prices: PrestaShop works them out from delivery ranges, zones and modules outside the webservice API.
- The webservice key the connector sends on every call comes from
PUBLIC_PRESTASHOP_API_KEY. SvelteKit sendsPUBLIC_variables to the browser, so every visitor to the store can read it and use whatever permissions the key has. - 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
| When you see | What to do |
|---|---|
| Boot fails with “the prestashop connector is active but PUBLIC_PRESTASHOP_API_URL is not set” | Add PUBLIC_PRESTASHOP_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/prestashop-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. |
[prestashop] 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 PrestaShop 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 PrestaShop’s maintainers: Is there a supported storefront auth path over the webservice API?
Offer a sandbox or a correctionFAQ
Questions about Svelte Commerce on PrestaShop
Can I run a PrestaShop store on Svelte Commerce today?
No. Shoppers can browse and fill a cart, but the webservice API has no shopper sign-in and no way to place an order — only a front-office payment module can do that — so every checkout path in the storefront is a placeholder.
How do I switch Svelte Commerce to PrestaShop?
Remove the connectors the storefront ships with, install @misiki/prestashop-connector, set PUBLIC_PRESTASHOP_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 can’t shoppers sign in on PrestaShop?
The webservice API has no customer login endpoint, so the connector’s auth throws rather than fake a session. The Svelte Commerce maintainers have asked PrestaShop’s maintainers whether a supported storefront sign-in path exists over the webservice API.
Has the PrestaShop connector been run against a real PrestaShop store?
Not against a live production instance — no Svelte Commerce connector has been. It was written by reading PrestaShop’s authoritative API source, and the Svelte Commerce maintainers ask PrestaShop’s own maintainers for a sandbox to run it against.
Sources
This page summarises PRESTASHOP.md in the Svelte Commerce repository and the PrestaShop connector’s source, read on , and the coverage in CONNECTORS.md, read on . Where they disagree with this page, they are right and this page is out of date. PrestaShop is a trademark of its owner, named here only to describe compatibility; no endorsement or affiliation is implied — see trademarks.
Read the whole guide
The storefront is the same on every backend; the connector is what changes. PRESTASHOP.md has the PrestaShop setup in full, beside the connector’s source.