Articles · 2026-11-08
XML product import into OpenCart without failures
Your supplier provides an XML feed and you want products, prices and stock on the site to update by themselves. Off-the-shelf import modules often work on a small catalog, but with a few thousand products they stop halfway, duplicate products or take the site down. Here’s how I set up imports that keep working for years.
Typical problems
- the import runs from the browser and stops at the PHP time limit;
- every update creates new products instead of updating existing ones;
- images are downloaded again every time and the disk fills with copies;
- products missing from the feed stay on sale with zero stock or, the other way round, get deleted along with their reviews and Google rankings;
- the site slows down for customers while the import runs.
How it should work
- run by cron from the command line, not from the browser, so there are no web server time limits;
- a stable product key: the supplier ID or SKU stored separately; products are matched only by it;
- only changed fields are updated: price and stock every time, description and images only when they change;
- products that leave the feed are disabled, not deleted, so the URL and reviews stay;
- category mapping between the supplier and the site is set once in a table;
- a lock against parallel runs so two imports don’t write to the database at once;
- a log: how many products were created, updated and disabled, and which errors happened.
Large feeds
A feed of tens of megabytes shouldn’t be loaded into memory whole. It’s read as a stream, product by product, and written to the database in batches, so the import takes minutes, not hours, and doesn’t get in customers’ way.
Several suppliers
With several suppliers each feed has its own format. The most reliable approach is to convert them all to one internal format and import with one piece of logic. A new supplier is then just a new “translator”, not a new module.
I’ve set up XML imports into OpenCart, images and galleries included, for several stores. If you need automatic catalog sync, it’s part of website integrations. If you need the opposite direction, exporting your products to marketplaces, see the free XML feed module.
FAQ
How often should the import run?
Prices and stock from a few times a day to hourly, depending on how often the supplier updates them. A full update of descriptions and images once a day or less.
Does this work for CSV or XLSX?
Yes, the logic is the same. Only the way the file is read changes.
Rather not dig into it yourself?
Tell me what is happening with your site, and I’ll reply with the cause and a fix estimate within a day.
More articles
Nov 10, 2026
Moving a site to another CMS without losing rankings
Moving to another CMS (WordPress, WooCommerce, OpenCart, custom PHP): what to migrate, how to set up 301 redirects and what to check after launch.
Nov 10, 2026
OpenCart vs WooCommerce: which to choose
OpenCart vs WooCommerce compared: speed on a large catalog, extensions, payments and shipping, blogging and SEO, maintenance cost. When each one fits better.
Nov 10, 2026
Abandoned carts in OpenCart: simplify checkout
Customers add to cart but don't order? What gets in the way of OpenCart checkout, which fields to remove and how to win back those who left.