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.

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

24 of 43 services wired, read from CONNECTORS.md on ; npm may carry a newer patch. How coverage is measured.

What the connector calls on PrestaShop

The connector calls PrestaShop’s REST webservice through its single /api gateway, forcing JSON responses with the Output-Format: JSON and Io-Format: JSON headers and sending every write as an XML body with Content-Type: text/xml, because the webservice reads no JSON input.

Every request carries HTTP Basic auth with the webservice key as the username and an empty password, which authenticates the shop rather than a shopper; there is no session or token to refresh, and shopper sign-in is not possible, so every auth method that would establish an identity throws NotSupportedError.

Requests the @misiki/prestashop-connector source makes, by storefront service
ServiceWhat it requests
productGET /api/products with display=full, filter[active]=[1], limit=offset,count and sort=[col_DIR]; a slug read is filter[link_rewrite]=[slug], completed by GET /api/combinations, /api/product_option_values, /api/product_options and /api/stock_availables
searchGET /api/search?query=…&language=… for product ids, then GET /api/products?filter[id]=[a|b|c]&display=full
categoryGET /api/categories?filter[active]=[1]&sort=[position_ASC]; GET /api/categories/{id}?display=full for the product ids in associations.products
cartPOST /api/carts with id_lang and id_currency; GET /api/carts/{id}?display=full; PUT /api/carts/{id} with the whole record; DELETE /api/carts/{id}
checkoutGET /api/carriers?filter[active]=[1]&filter[deleted]=[0]&sort=[position_ASC] for shipping options
orderGET /api/orders?display=full with filter[reference] and filter[id_customer]; GET /api/orders/{id}; GET /api/order_histories?filter[id_order]=[id] for tracking
addressGET /api/addresses; POST /api/addresses; PUT /api/addresses/{id}; DELETE /api/addresses/{id}

PrestaShop rules the connector follows

Read from the source of misiki-in/prestashop-connector at commit 1d71757 of . Where the code has changed since, the code is right.

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

Switching works the same way on every backend: what all 26 share, from one connector at a time to store identity.

Environment variables

What Svelte Commerce reads to reach PrestaShop
VariableRequiredWhat it does
PUBLIC_PRESTASHOP_API_URLYesYour PrestaShop shop’s URL. Boot fails, naming this variable, if it is missing.
PUBLIC_PRESTASHOP_API_KEYNoThe webservice key from Advanced Parameters › Webservice. Every call needs it. See the limitations.
PUBLIC_PRESTASHOP_LANGUAGE_IDNoThe shop’s language ID, sent as language=<id> so translatable fields come back as plain values rather than per-language arrays.
PUBLIC_PRESTASHOP_SHOP_IDNoMultistore shop ID (id_shop). Falls back to PUBLIC_PRESTASHOP_STORE_ID when unset.
PUBLIC_PRESTASHOP_SHOP_GROUP_IDNoMultistore shop group ID (id_group_shop).
PUBLIC_PRESTASHOP_STORE_IDNoRead as the shop ID when PUBLIC_PRESTASHOP_SHOP_ID is unset.
PUBLIC_CONNECTORNoOnly 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

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.

Limitations on PrestaShop

Before you rely on it

No connector has been exercised against a live production instance of its platform; each was written from the platform’s published source. The limits every backend shares and the errors every switch can meet are on the backends page.

An open question for PrestaShop’s maintainers: Is there a supported storefront auth path over the webservice API?

Offer a sandbox or a correction

FAQ

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.

Sources

PRESTASHOP.md, read on ; CONNECTORS.md, read on ; the connector’s source at 1d71757. Where they disagree with this page, they are right. PrestaShop is a trademark of its owner, named only to describe compatibility; see trademarks.

Read the whole guide

Chat on WhatsApp