To integrate PrestaShop with Lovable, create a Supabase Edge Function that authenticates with your PrestaShop Web Service API key and converts XML responses to JSON. Store your API key and store URL in Cloud Secrets. This gives your existing PrestaShop store a modern React frontend built in Lovable without migrating any product or order data.
Build a Modern React Frontend for Your PrestaShop Store
PrestaShop is the leading e-commerce platform in France, Spain, and much of Latin America, with over 300,000 active stores. Its default themes are functional but can feel dated compared to modern React storefronts. With Lovable, you can build a custom React frontend for your existing PrestaShop store — keeping all your product catalog, pricing, inventory, and order data in PrestaShop while giving customers a fast, visually polished experience.
The key technical challenge with PrestaShop is its Web Service API: unlike modern REST APIs that return JSON, PrestaShop's API returns XML by default. Your Supabase Edge Function needs to parse this XML and convert it to JSON before sending it to your React components. The Edge Function also handles Basic Auth encoding of your API key (PrestaShop uses the API key as the username with an empty password in HTTP Basic Auth).
PrestaShop's Web Service API is a RESTful API that exposes all store resources: products, categories, customers, orders, addresses, images, and more. Once you understand the XML-to-JSON conversion step, the rest follows standard patterns for Edge Function API proxying. This guide focuses on the most commonly needed resources: products with multilingual names and descriptions, categories for navigation, and orders for customer-facing lookups.
Integration method
PrestaShop integration in Lovable uses Supabase Edge Functions to proxy requests to your store's Web Service API. The Edge Function authenticates using HTTP Basic Auth with your PrestaShop API key, handles XML-to-JSON conversion (since PrestaShop's Web Service returns XML by default), and returns clean JSON data to your React components. Your API key and store URL are stored encrypted in Cloud Secrets and accessed via Deno.env.get().
Prerequisites
- A live PrestaShop store (version 1.7+ recommended) with admin access
- PrestaShop Web Service feature enabled in the admin panel (Advanced Parameters → Webservice)
- Your PrestaShop store on HTTPS — the Web Service API should be accessed over SSL
- A Lovable project with Lovable Cloud enabled
- Familiarity with PrestaShop's admin panel for configuring Web Service permissions
Step-by-step guide
Enable PrestaShop Web Service and generate an API key
Enable PrestaShop Web Service and generate an API key
Log into your PrestaShop admin panel and navigate to Advanced Parameters → Webservice. If you do not see this menu item, ensure your PrestaShop version supports the Web Service feature (version 1.5 and above). On the Webservice page, toggle 'Enable PrestaShop Webservice' to Yes if it is not already enabled. Then click 'Add new webservice key'. On the key creation form, the 'Key' field can be auto-generated by clicking the 'Generate' button — this creates a 32-character alphanumeric key that is your API authentication credential. Fill in a description like 'Lovable Frontend'. Under Permissions, select the resources your Lovable app needs to access. For a read-only product catalog, check the GET permission for 'products', 'categories', 'images', and 'languages'. For order lookup, also check GET for 'orders' and 'customers'. Check only the minimum permissions your integration needs. Click Save to create the key. Note down the 32-character key — it is displayed on the key creation page and in the key list afterward so you can retrieve it later if needed.
Pro tip: Start with read-only (GET) permissions for all resources. Add write permissions only when you have a specific feature that requires creating or updating PrestaShop data.
Expected result: A PrestaShop Web Service key appears in the Webservice keys list with your selected permissions.
Add PrestaShop credentials to Cloud Secrets
Add PrestaShop credentials to Cloud Secrets
Open your Lovable project and click the '+' icon next to the Preview to open the Cloud tab. Navigate to the Secrets section in the Cloud panel. Add two secrets: PRESTASHOP_API_KEY with your 32-character Web Service key as the value, and PRESTASHOP_STORE_URL with your store's base URL — for example https://mystore.com — with no trailing slash. The PRESTASHOP_STORE_URL is technically a public value but storing it as a secret makes your Edge Function environment-flexible, so you can switch between staging and production stores without code changes. PrestaShop's Web Service uses HTTP Basic Auth where the API key is the username and the password is empty — your Edge Function will encode this as Base64. These secrets are encrypted at rest and only accessible from Deno Edge Functions, never from your React components. Lovable's SOC 2 Type II certified infrastructure ensures your PrestaShop API key is handled with production-grade security.
Pro tip: When testing locally or against a staging store, temporarily update PRESTASHOP_STORE_URL in Cloud Secrets to point to your staging environment — no code changes needed.
Expected result: PRESTASHOP_API_KEY and PRESTASHOP_STORE_URL appear in your Cloud Secrets panel.
Create the PrestaShop proxy Edge Function with XML parsing
Create the PrestaShop proxy Edge Function with XML parsing
Ask Lovable to create a Supabase Edge Function that proxies requests to your PrestaShop Web Service API and handles XML-to-JSON conversion. This is the most technically involved part of the integration because PrestaShop returns XML, not JSON. Deno does not have a built-in XML parser, but you can use a lightweight approach with the DOMParser available in Deno's Web API, or import an XML parsing library from deno.land/x. The Edge Function should accept a 'resource' parameter (e.g., products, categories, orders) and optional 'id' and 'filter' parameters. It builds the PrestaShop API URL as PRESTASHOP_STORE_URL + /api/ + resource with output_format=JSON appended — PrestaShop Web Service actually supports JSON output via the output_format=JSON query parameter, which is far simpler than parsing XML. Always use output_format=JSON to avoid the XML parsing complexity entirely. The Edge Function constructs a Basic Auth header by Base64 encoding the API key with a colon and empty password, then forwards the request and returns the JSON response.
Create a Supabase Edge Function called prestashop-proxy that proxies requests to my PrestaShop Web Service API. Read PRESTASHOP_API_KEY and PRESTASHOP_STORE_URL from Deno.env.get(). Accept 'resource', 'id', and 'filter' query parameters. Build the URL as PRESTASHOP_STORE_URL + '/api/' + resource + '?output_format=JSON'. Authenticate using Basic Auth by encoding PRESTASHOP_API_KEY + ':' as Base64 (empty password). Return the JSON response with CORS headers.
Paste this in Lovable chat
1import { serve } from "https://deno.land/std@0.168.0/http/server.ts";23const corsHeaders = {4 "Access-Control-Allow-Origin": "*",5 "Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",6};78serve(async (req) => {9 if (req.method === "OPTIONS") {10 return new Response("ok", { headers: corsHeaders });11 }1213 try {14 const apiKey = Deno.env.get("PRESTASHOP_API_KEY");15 const storeUrl = Deno.env.get("PRESTASHOP_STORE_URL");1617 if (!apiKey || !storeUrl) {18 return new Response(19 JSON.stringify({ error: "PrestaShop credentials not configured" }),20 { status: 500, headers: { ...corsHeaders, "Content-Type": "application/json" } }21 );22 }2324 const url = new URL(req.url);25 const resource = url.searchParams.get("resource") || "products";26 const id = url.searchParams.get("id");27 const limit = url.searchParams.get("limit") || "20";2829 let psPath = `/api/${resource}`;30 if (id) psPath += `/${id}`;3132 const psUrl = new URL(`${storeUrl}${psPath}`);33 psUrl.searchParams.set("output_format", "JSON");34 psUrl.searchParams.set("limit", limit);3536 // Forward any filter parameters (PrestaShop filter syntax: filter[field]=value)37 url.searchParams.forEach((value, key) => {38 if (key.startsWith("filter")) {39 psUrl.searchParams.set(key, value);40 }41 });4243 // PrestaShop Basic Auth: API key as username, empty password44 const credentials = btoa(`${apiKey}:`);4546 const response = await fetch(psUrl.toString(), {47 headers: {48 "Authorization": `Basic ${credentials}`,49 "Accept": "application/json",50 },51 });5253 if (!response.ok) {54 const text = await response.text();55 return new Response(56 JSON.stringify({ error: `PrestaShop returned ${response.status}`, detail: text }),57 { status: response.status, headers: { ...corsHeaders, "Content-Type": "application/json" } }58 );59 }6061 const data = await response.json();62 return new Response(JSON.stringify(data), {63 headers: { ...corsHeaders, "Content-Type": "application/json" },64 });65 } catch (error) {66 return new Response(67 JSON.stringify({ error: error.message }),68 { status: 500, headers: { ...corsHeaders, "Content-Type": "application/json" } }69 );70 }71});Pro tip: Always append output_format=JSON to PrestaShop API requests. Without it, the API returns XML which requires an extra parsing step.
Expected result: The prestashop-proxy Edge Function is deployed. Test it by calling it with resource=products from Cloud → Logs.
Fetch and display PrestaShop products in React
Fetch and display PrestaShop products in React
With the Edge Function deployed, ask Lovable to build a product catalog React component. PrestaShop's product API response structure wraps items in the resource name as a key — for example, calling /api/products returns { products: [ { id, name, price, ... } ] }. When requesting a single product by ID, the response is { product: { ... } }. PrestaShop multilingual fields (name, description, meta_title) are returned as arrays of language objects: [ { id: 1, value: 'Product Name in French' }, { id: 2, value: 'Product Name in English' } ]. Your React component needs to select the correct language by matching language ID to the user's preferred language. Product images are separate resources — call /api/images/products/{product_id} to get image URLs. Ask Lovable to create a component that fetches the product list, then fetches images for each product, and displays them in a responsive grid with name (using the first language variant), price formatted with the store's currency, and stock availability.
Create a PrestaShopCatalog React component that fetches products from my prestashop-proxy Edge Function with resource=products. Handle the PrestaShop response format where products are nested in a 'products' key. For each product, display the multilingual name (take the first language value), formatted price, and a product image. Build the image URL as PRESTASHOP_STORE_URL + '/api/images/products/' + id + '/1' for the first image. Show a 3-column product grid with cards.
Paste this in Lovable chat
Pro tip: PrestaShop product prices are returned as strings in the store's default currency. Use the /api/currencies endpoint to get the currency symbol for display.
Expected result: PrestaShop products display in a React grid with images, names, and prices fetched from your live store.
Handle PrestaShop image URLs and language switching
Handle PrestaShop image URLs and language switching
PrestaShop images are served through a dedicated image API separate from the product data endpoint. The URL structure for product images is: STORE_URL/api/images/products/PRODUCT_ID/IMAGE_ID where IMAGE_ID starts from 1. When you request a product's full details by ID (/api/products/{id}?output_format=JSON), the response includes an associations.images array listing all image IDs for that product. For the product listing page, you can shortcut this by using the image URL pattern directly with image ID 1 for the main image, then fetch additional images only on the product detail page. For language handling, fetch the available languages from /api/languages?output_format=JSON to get the mapping between language IDs and language codes (e.g., 1 = fr, 2 = en). Store the current language preference in React state or local storage. When displaying multilingual fields, filter the language array by the matching language ID. Lovable can help generate a custom hook called usePrestaShopLanguage that reads the browser's navigator.language, maps it to a PrestaShop language ID, and exports a helper function to extract the correct translation from any multilingual field.
Create a usePrestaShopLanguage React hook that fetches available languages from my prestashop-proxy Edge Function (resource=languages), maps the browser's navigator.language to a PrestaShop language ID, and returns a translate(field) function that extracts the correct language value from a PrestaShop multilingual field array. Use English as fallback if the user's language is not available.
Paste this in Lovable chat
Pro tip: PrestaShop language IDs are store-specific and not standardized — always fetch /api/languages to get the correct mapping rather than hardcoding language IDs.
Expected result: Product names and descriptions display in the customer's browser language, with English fallback for unsupported languages.
Common use cases
Multilingual product catalog for European storefronts
Fetch PrestaShop products with all language variants and display them based on the customer's browser language. PrestaShop stores product names, descriptions, and meta fields in multiple languages simultaneously — your React component can switch between them without additional API calls.
Create a product catalog page that fetches products from my PrestaShop store via an Edge Function. The Edge Function should call /api/products from PrestaShop, convert the XML to JSON, and return products with their multilingual names and descriptions. Display products with image, name, and price in a responsive grid.
Copy this prompt to try it in Lovable
Category navigation tree
Build a category menu that mirrors PrestaShop's full category hierarchy. The Categories API returns all categories with parent-child relationships, letting you build nested navigation menus or breadcrumb trails that match your store's existing structure.
Fetch all categories from my PrestaShop store using an Edge Function calling /api/categories. Convert the XML response to JSON and return a nested category tree. Build a sidebar navigation component that shows the category hierarchy with clickable links. Show only active categories with id_parent relationships preserved.
Copy this prompt to try it in Lovable
Customer order history page
Let authenticated customers view their order history by querying the PrestaShop Orders API filtered by customer ID. Display order status, items purchased, totals, and shipping information — all from your existing PrestaShop order data.
Build an order history page that fetches orders for a specific customer from PrestaShop via an Edge Function calling /api/orders with a filter for customer ID. Display each order with order reference, date, total amount, and current status. Convert the XML response to JSON in the Edge Function before returning to the frontend.
Copy this prompt to try it in Lovable
Troubleshooting
Edge Function returns 401 Unauthorized when calling PrestaShop API
Cause: The Basic Auth encoding is incorrect, or the PRESTASHOP_API_KEY value in Cloud Secrets does not match the key in PrestaShop. PrestaShop Basic Auth requires the API key as username with an empty password — the colon after the key is required.
Solution: Verify the API key in Cloud Secrets matches exactly the key shown in PrestaShop admin under Advanced Parameters → Webservice. Check that the Base64 encoding includes the trailing colon: btoa(apiKey + ':') not btoa(apiKey). Also verify the Web Service is enabled in PrestaShop — the toggle must be Yes.
1const credentials = btoa(`${apiKey}:`);PrestaShop API returns XML even though output_format=JSON is set
Cause: Some older PrestaShop versions or misconfigured servers ignore the output_format query parameter and return XML regardless. This can also happen if the URL is malformed and the query parameter is not being sent.
Solution: Verify the request URL in Cloud → Logs includes ?output_format=JSON. Some PrestaShop installations require the parameter to be &output_format=JSON when combined with other parameters. If XML is unavoidable, use Deno's DOMParser to convert it: const parser = new DOMParser(); const doc = parser.parseFromString(xmlText, 'text/xml');
Product images return 404 or a PrestaShop login page instead of the image
Cause: PrestaShop image access through the Web Service API requires authentication just like other resources. If the image endpoint is called without Basic Auth headers, it may redirect to the store login page or return 404.
Solution: For displaying product images in your React frontend, use the public image URL (STORE_URL/img/p/IMAGE_PATH) rather than the API image endpoint. Go to a product in your PrestaShop admin, right-click the product image, and copy the URL — this shows the public image path format. Alternatively, serve images through your Edge Function with the same Basic Auth headers.
Edge Function returns a 503 or timeout connecting to PrestaShop
Cause: Your PrestaShop server is on shared hosting with slow response times, or the server has IP blocking enabled that is rejecting requests from Supabase Edge Function IP ranges.
Solution: Check your PrestaShop server's error logs for the incoming connection. If your hosting provider has a firewall or mod_security blocking requests, whitelist Supabase's IP ranges or contact your host to disable aggressive bot blocking for the /api/ path. For slow servers, increase the Edge Function timeout by breaking product fetching into smaller requests with lower limit values.
Best practices
- Always use output_format=JSON in your PrestaShop API requests — it avoids the need for XML parsing and returns cleaner, more consistent data
- Use the limit parameter to paginate PrestaShop responses — by default PrestaShop may return up to 50 records but limiting to 20 keeps Edge Function response times fast
- Cache PrestaShop category trees in Supabase since categories rarely change — fetching them fresh on every page load adds unnecessary latency
- Handle PrestaShop multilingual fields consistently: always fetch /api/languages first to build the language ID map, then use a shared translation helper function across all components
- Test with a PrestaShop staging environment first — many European stores run PrestaShop on shared hosting where excessive API calls from testing can trigger rate limits
- Store PrestaShop image URLs in Supabase after first fetch rather than constructing them dynamically on every render — the API image path format varies between PrestaShop versions
- Use PrestaShop's filter syntax for targeted queries (filter[active]=1 to only return active products) rather than fetching all records and filtering in React
Alternatives
WooCommerce is built on WordPress and is more popular globally, making it a better choice if your team is already familiar with WordPress or you need the larger WooCommerce plugin ecosystem.
Magento suits enterprise teams with complex multi-store setups and B2B requirements, while PrestaShop is better for small to mid-size stores needing a lighter-weight European-friendly platform.
Shopify is a native Lovable connector with AI-assisted setup and no Edge Function required, making it the faster integration choice if you are starting a new store from scratch.
Frequently asked questions
Does Lovable have a native PrestaShop connector?
No. As of March 2026, Lovable's 17 shared connectors do not include PrestaShop. Integration requires the Edge Function approach described in this guide. Shopify is the only e-commerce platform with a native Lovable connector.
Which PrestaShop version is compatible with this integration?
PrestaShop 1.6 and above supports the Web Service API used in this guide. PrestaShop 1.7+ is recommended for the most stable API behavior and JSON output format support. If you are on PrestaShop 8.x (the latest major version as of 2024), all features described here are fully supported.
Can this integration handle PrestaShop's multi-store (multi-shop) feature?
Yes, but with extra configuration. PrestaShop multi-store setups expose separate Web Service endpoints per shop or use a ps_shop_id parameter to filter results. When creating your Web Service key in PrestaShop admin, you can restrict it to a specific shop context. Update your PRESTASHOP_STORE_URL in Cloud Secrets to point to the specific shop's URL if each shop runs on a different subdomain.
How do I display PrestaShop product images in my React app?
PrestaShop images can be accessed via two methods. The API method requires Basic Auth headers (same as other API calls), which must go through your Edge Function. The simpler method is the public image URL — navigate to a product in your PrestaShop admin, view the product image URL, and note the path format (usually /img/p/ followed by the image ID broken into subdirectories). For a production-ready solution, fetch image data through the Edge Function and store image URLs in Supabase to avoid repeated API calls.
Will this work for a PrestaShop store hosted on a local server or intranet?
No. Supabase Edge Functions run on cloud infrastructure and need to reach your PrestaShop server over the public internet. Your PrestaShop installation must be on a server with a public HTTPS URL. For local development testing, use a staging server or a tunneling tool to temporarily expose your local environment with a public URL.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation