Get a quote

How to automatically import supplier XML products into PrestaShop

Marius, PHP developer · Published 2026-10-19

If you get your products from suppliers, you most likely receive their catalogue as XML, CSV or through an API. Adding a few dozen products by hand is still possible, but when a supplier has thousands of products and prices and stock change every day, manual work becomes a constant source of errors. In this article I explain how automatic supplier XML product import into PrestaShop works, what to pay attention to and which problems come up most often. I write from my own experience: I have been building PrestaShop and OpenCart product import modules for many years and currently have modules ready for 114 different suppliers.

Why automate product import

Automatic import solves three things: time, accuracy and up-to-date data.

  • Time. New products are created without copying – names, descriptions, images and features are taken from the supplier data.

  • Accuracy. Prices and stock in the store match the supplier data, so there are fewer orders for products that are no longer available.

  • Up-to-date data. Data is updated on a schedule, for example several times a day, and nobody has to remember to do it.

Automated import also makes it easier to grow the range: products from a new supplier can be added without changing the whole workflow.

What a supplier XML or CSV feed usually contains

Every supplier provides data in its own way, but a file or API response usually contains:

  • the product code (SKU), the manufacturer code and often an EAN barcode;

  • the name and description, sometimes in several languages;

  • the supplier category or category tree;

  • the manufacturer (brand);

  • the wholesale price, sometimes also a recommended retail price;

  • stock or availability status;

  • image links;

  • technical parameters and options – size, colour, capacity and so on;

  • weight, dimensions or other additional information.

Data can be in one large XML file, in several separate files (for example products and stock separately) or available through an API with a login. Before building the import it is important to find out where each required field is and how often the supplier updates it.

Mapping categories, attributes and images

The supplier data structure almost never matches your store structure, so the most important part of an import is mapping.

Categories

There are two options: import the supplier categories as they are, or map the supplier categories to the categories you have created. The second option is usually better – the store menu stays tidy and similar products from several suppliers end up in the same category. It is also possible to import products only from selected categories or manufacturers and skip the rest.

Attributes and options

In PrestaShop, technical parameters usually become features, while sizes or colours become combinations. It is important that the same values are not repeated in different spellings, for example “XL” and “xl”, because store filters then work poorly.

Images

Images are downloaded from the supplier server and assigned to the product. To keep the import fast, it is worth downloading images only for new products or only when they have changed, not every time from scratch.

Price and markup rules

A supplier usually provides a wholesale price, while the store needs a retail price. That is why the import has pricing rules, for example:

  • a percentage markup for all products;

  • different markups in different price ranges – higher for cheaper products, lower for more expensive ones;

  • a fixed markup added to the percentage one;

  • separate markups by category or manufacturer;

  • a price multiplier and a tax (VAT) rule.

It is also possible to import only products whose supplier price is within a given range, or only those whose stock is above a set limit.

Stock and price updates via cron

Once products are created, usually only the price, stock and status change. That is why an import usually has several modes: a full import that creates new products and updates existing ones, and an update mode that does not create new products and only updates existing ones.

The update runs automatically through a server cron job – via an HTTP address or from the command line (CLI, SSH). How often to run it depends on the supplier: some update their data once a day, others every hour. There is no point importing more often than the supplier updates its file.

It is important to decide what happens to a product that has disappeared from the supplier list: it can be disabled, its quantity set to 0 or it can be deleted. Sold-out products can be disabled and automatically enabled again when they are back in stock.

Several suppliers in one store

Many stores work with several suppliers. In that case each supplier has its own import with its own settings, but all of them work in the same PrestaShop store together with manually added products. The key point is that one import must not touch another supplier’s products or products created by hand – that is why each product is marked with the source it came from.

If the same product is available from several suppliers, you need a clear rule about which supplier’s price and stock are used. Such products are usually matched by EAN or manufacturer code.

Common problems and how to avoid them

Duplicate products

Duplicates appear when a product is matched not by a stable code but, for example, by its name, or when the supplier changes the product code. The solution is to match products by a unique supplier code or EAN and not create a new product if it already exists.

Image errors

Supplier image links sometimes do not work, images can be very large or their addresses change. The import has to skip broken links without stopping and must not download the same images every time.

Encoding and broken characters

If you see strange symbols instead of local characters, the cause is usually the wrong encoding (for example Windows-1257 instead of UTF-8) or messy HTML in descriptions. Data has to be converted and cleaned before it is saved to the store.

Timeouts

A large XML file with tens of thousands of products may not finish importing within the time the server allows, especially when the import is started in a browser. Importing in parts, running from the CLI and a separate fast price and stock update all help.

Manual changes

If you correct a product name or description, the next import should not overwrite it. That is why it is common to update only price, quantity, status and combinations, and to exclude specific products from updates altogether when needed.

How my import modules handle this

My PrestaShop product import modules are built on the same import engine that I have been improving for many years, and each supplier’s data structure is handled individually. Depending on the module and the supplier, the following features are available:

  • import of selected supplier categories and manufacturers into your categories, or together with the supplier categories;

  • several import modes: standard, updates only and full;

  • price multiplier, fixed and percentage markups by price range, category and manufacturer (not in every module);

  • disabling, deleting or setting quantity to 0 for products that disappeared from the supplier list;

  • import by minimum quantity and price range;

  • the option to exclude specific products from price, quantity or status updates;

  • running from the browser or the CLI, so it works with cron jobs;

  • working together with other import modules and manually added products.

So far I have built 167 different modules, 538 licences have been sold, and import modules are ready for 114 different suppliers. I test the modules in real-world selling. Examples of supplier modules: ALSO, ABC Data, TD Baltic, Asbis / IT4profit and Deltaco Baltic. The full list is at PrestaShop product import modules, and how a module works is explained in how the PrestaShop product import module works. For import in both PrestaShop and OpenCart stores, see automated product import.

If your supplier is not on the list, I will build a module based on its XML, CSV or API data structure.

Frequently asked questions

Can I import products from several suppliers into one store?

Yes. Each supplier has a separate import with its own settings, and all of them work in the same store together with manually added products.

Will the import overwrite descriptions I have edited?

Normally not. After the first import only price, quantity, status and combinations are updated, so you can edit names and descriptions freely.

How often is stock updated?

As often as the cron job is set to run and as often as the supplier updates its data – for example every hour or several times a day.

Does this work for OpenCart?

Yes, I build the same kind of import modules for OpenCart too – see OpenCart product import modules.

Need automatic import for your supplier?

Write which supplier you work with and which PrestaShop version you use. If you have the supplier’s XML link or API documentation, attach it. I reply within one business day.

Get a quote

← All articles

Contact Me!

Do you have questions about PrestaShop or OpenCart modules, product import solutions, SilverStripe, or custom PHP development?

Write to me, and I will respond promptly to help you find the best solution for your business.

Contact information

MB „Optimalus kodas“ Company no: 303225585
Bank details IBAN: LT427044060007941508
AB SEB bankas
SWIFT: CBVILT2X

Contact me

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. More: Privacy Policy.