CREATIVITY

PRECISION

INNOVATION

SPARCLEY

0%
Distribution warehouse with shelving full of cardboard boxes and yellow stock crates
BACK TO BLOG

OpenCart supplier import: XML feeds, stock sync and pricing

Our OpenCart supplier import module turns supplier XML feeds into products and keeps price, stock and status in sync by cron, with rule-based pricing.

CategoryOpenCart
TopicSupplier feed import
Read Time6 min
Article#08 / 15
01

What is the OpenCart supplier import module?

Supplier Import – Product Import & Stock Sync is an OpenCart supplier import module for OpenCart 3.0.x. It reads your suppliers' XML feeds, creates products from the categories you approve and keeps the price, stock and status of those products up to date on a cron schedule. It is built for stores that resell or dropship from several distributors and no longer want to update prices and quantities by hand.

It is one of four modules SPARCLEY has just published on the OpenCart Marketplace. Version 2.6 is listed at $69 with 12 months of free support and full documentation. We built it for a live OpenCart 3 store that imports from several suppliers every day, so each feature below comes from real catalogue work rather than a wish list.

02

How do you add a supplier feed in OpenCart?

Each supplier is set up in three steps under Catalog > Supplier import: Supplier, Fields and Categories. The source is either a Feed URL that the cron downloads or a file you upload, and it is an OpenCart XML product import: one product element per item. A Deduct VAT option divides feed prices by 1.21 (21% VAT), and an exclusion list skips products whose names contain phrases you enter.

Field mapping reads the tags from the first product in the feed. Product name, meta title, product code (model) and category are required; SKU, price, weight, quantity, description, EAN, image, manufacturer and purchase price without VAT are optional. The product code links an item between two feeds, so map it to a value that never changes.

Category mapping lists every supplier category in the feed. You pick a store category, tick Verify and set a Price % between −100 and 100 as a markup or discount. New products come only from verified categories, so a supplier's new range cannot flood your catalogue, while existing products in unverified categories still get stock updates.

03

How does supplier stock sync work?

The module downloads each supplier's feed once a day. You add one cron job per supplier, typically every 15 minutes; later runs continue an unfinished import from its saved position, so a large feed is processed in parts. If the supplier's server answers HTTP 503 or times out, a command-line run retries after 75 seconds, up to three attempts in five minutes.

The first import is a full import. After that, only new and removed items are processed, plus items whose price, quantity, name, category or image changed, which keeps automatic price and stock updates short even on a big catalogue. Individual products can be excluded from updates or have fields such as price or description locked (in version 2.6 a developer sets this up; it is not yet in the admin). What happens to each item:

  • New products are enabled when quantity is above 0 and created disabled when it is 0.
  • Quantity above 0 re-enables an existing product; quantity 0 keeps its status and shows it as out of stock.
  • Products that leave the feed are disabled, never deleted, and get price, stock and status back when they return.
  • Missing images are downloaded to your server; existing images are kept, and an empty feed description never blanks a filled one.
04

What protects your catalogue from a broken feed?

Supplier feeds fail in predictable ways: an empty file, a half-finished export, stock that suddenly reads zero everywhere. The importer guards against each case:

  • Feed validation: a file that is not XML or has no product elements is rejected before anything changes.
  • Mass-disable guard: if a run would disable more than 10 products or 20% of the supplier's enabled products, whichever is larger, nothing is disabled and an error is logged.
  • Stock guard: if the previous feed had at least 20 items in stock and the new one has 10% of that or less, stock is not zeroed in that run.
  • Run lock: a supplier is never imported by two runs at once.
  • Error isolation: a failing product is logged and skipped while the rest of the feed carries on.
  • Stuck imports: a run with no progress for two hours is flagged, and Reset import position restarts it.
05

How do pricing rules set the final price?

Pricing rules live under Catalog > Supplier import > Pricing, per supplier. Exactly one rule prices a product – rules never add up – in a fixed order: price lock, product rule, brand rule, supplier rule, category rule, pinned discount, category % and no change. Within a level, the rule with more conditions wins, then the higher priority.

Rules match on manufacturer, store category, supplier category and a base price range. The action is a markup formula – base × (1 + % / 100) + a fixed amount, rounded to cents – or a fixed price for single-product rules, with the feed price without VAT as the base. Why this price? explains any product rule by rule.

When the purchase price is mapped, the pricing rules are designed to keep each price at or above cost: the import does not write a lower price, and a daily price check raises anything that slipped under it. The exceptions are a locked price, which is kept and reported, and a cost floor switched off with a setting. Version 2.6 also gives every enabled copy of a duplicated product, matched by GTIN or by manufacturer code and brand, the group's highest price; it runs as a report-only dry run until you switch it on. Changes go live in steps:

  • Save a new or edited rule as a pending change.
  • Preview impact: prices up, down or unchanged, conflicts and the largest changes, with a CSV download.
  • Confirm if the change touches over 20% of the supplier's enabled products or moves one price by over 30%.
  • Apply writes prices in batches of 500; Sync prices then confirms nothing is left to change.
  • History logs every apply, and Roll back restores the previous rules and prices of the latest batch.
06

How do you schedule and monitor the imports?

The module does not schedule itself. Each supplier's ready-to-copy cron command appears under Settings > Cron, usually set to run every 15 minutes. PHP CLI is recommended for OpenCart 3 import cron jobs; without shell access, a token-protected HTTP URL works with a web cron service, though long imports may hit the server time limit.

The import log keeps one row per supplier per day with processed, inserted, updated and not-verified counts. The Cron page shows the schedule, last run, position and last feed download for each supplier.

A daily health check runs after a report hour you choose and emails the result every day or only when there are errors or new warnings. It covers:

  • failed, stuck or missed imports and guard events
  • feeds whose content has not changed for seven days or more
  • enabled products sold below purchase cost, including specials and quantity discounts
  • unmapped categories and the OpenCart error log
  • orders, with a warning after 72 hours without one
  • our XML feed generator and DPD tracking modules, when installed
07

What should you check before installing it?

You need OpenCart 3.0.x, PHP 7.4 or newer with cURL, XMLReader, SimpleXML, mbstring and JSON, MySQL or MariaDB with InnoDB, cron access on your hosting and working store mail. English and Lithuanian admin languages are included, and no OpenCart core files are overwritten. Worth knowing about version 2.6:

  • Version 2.6 works with XML feeds; if a supplier only offers CSV or XLS, send us a sample before you buy.
  • New products get a fixed default tax class, stock status and store, so check that these match your setup after the first import.
  • On Journal3, import runs can rebuild a theme menu from your top-level categories, so back up the theme settings before the first import.
  • Daily check findings and the report email are currently in Lithuanian.
08

Can SPARCLEY set it up for your store?

Yes. Supplier XML structures vary – nested fields, namespaces and variants all behave differently – so the simplest first step is to send us a sample feed. We will tell you whether it maps cleanly, configure the module on a staging copy of your store before any production import runs, and can then watch the import reports for you as part of ongoing store care.

09

Frequently asked questions

Which OpenCart versions does Supplier Import support?

Version 2.6 is built for OpenCart 3.0.x and needs PHP 7.4 or newer with cURL, XMLReader, SimpleXML, mbstring and JSON. The OpenCart Marketplace listing shows compatibility with OpenCart 3.x.x.x.

Can it import CSV or Excel supplier files?

Version 2.6 is built around XML feeds with one product element per item. If your supplier only offers CSV or XLS, send us a sample and we will advise on the options.

Does the module delete products that disappear from the supplier feed?

No. Products that leave the feed are disabled, not deleted, and get their price, stock and status back when they return. If a run would disable more than 10 products or 20% of the supplier's enabled products, whichever is larger, nothing is disabled and an error is logged.

Can a pricing rule sell a product below my purchase cost?

Not by default, once you map the purchase price without VAT: the pricing rules are designed to keep the price at or above it. The exceptions are a manual price lock, which can keep a lower price and is reported in the import log and the daily check, and a cost floor switched off with a setting.

Do I need SSH access to run the imports?

No, but it helps. PHP CLI cron is recommended; without shell access you can call a token-protected HTTP URL from a web cron service, though very long imports may hit the web server time limit.

How much does Supplier Import cost?

It is listed at $69 on the OpenCart Marketplace, with 12 months of free support and documentation included.

Let's Build
Something.

From concept to live — premium design, real results.