No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Original Subtotal:
Product discounts:
Quantity Discount:
Total:
View Cart
CRM, accounting and import

Importing Products into OpenCart from Excel and CSV: Step by Step, Without Duplicates

How to upload and update products in OpenCart 3.0 and 4.1 from Excel or CSV: preparing the file, choosing an import method, checking the result, and common errors.

11 min read

Importing products into OpenCart from Excel or CSV is not part of the standard features of either 3.0 or 4.1. You will need an import module or your own script. The most important work happens before the import: the file must be in UTF-8, have one unchanging product key (usually the SKU), and have columns that match OpenCart fields. Below, we cover how to prepare the spreadsheet, how to run the first import without duplicates, and how to update prices and stock regularly afterward. The examples are for OpenCart 4.1; in 4.0.x, model triggers and event handling work differently.

Can OpenCart import products from Excel out of the box?

No. In the Catalog → Products section, you can only create and edit products one at a time. Neither OpenCart 3.0 nor 4.1 has a separate spreadsheet loader. So a catalog of several hundred items, or a supplier price list that is updated weekly, is handled in a different way. There are four options, and each suits a different task.

ApproachWhen it fitsLimitations
XLSX/CSV import moduleThe owner or manager creates and updates the catalog on their ownCheck compatibility with your version and theme
Custom scriptNon-standard file structure, large volumes, scheduled automationRequires a developer and ongoing maintenance
Supplier price list processing moduleSeveral suppliers with their own formats, daily price updatesInitial setup of the rules takes time
Google Sheets syncSmall catalog, prices and stock kept in a spreadsheetUsually not a full import of new products

For most stores, the best way to start is with a module. An example of such a solution is Import / Export Products XLSX and CSV. It can export the existing catalog to a file and upload it back. If the data format is complex or the import must run without human involvement, it is better to write a product import script that prevents duplicates. When prices are kept in a spreadsheet, price and stock exchange with Google Spreadsheets will be useful.

How do you prepare an Excel or CSV file for import?

Most import problems start with the spreadsheet, not the module. The simplest way to get the correct structure is this: manually create 2–3 products, export them with the same module, and fill in the ready template. The column names will then match what the module expects.

Product key

The key lets the module understand which row in the file corresponds to which product on the site. Usually the key is the Model field (required in 3.0 and 4.1) or the SKU. Key values must be unique and never change. If a supplier changes the SKU format, a repeat import will create copies of all products instead of updating existing ones. A product name is not suitable as a key: one extra space in one place or a corrected letter in another creates a duplicate.

Minimum set of columns

  • Model or SKU: unique key.
  • Name and Meta TitleThe page title in search results. More in the glossary → for each store language. Ukrainian and English need separate columns.
  • Price in the store's base currency, with a period as the decimal separator: 1299.00, not 1 299,00 грн.
  • Quantity and Status (1 means enabled, 0 means disabled).
  • Category: a path like Взуття > Кросівки or the ID of an existing category, depending on what the module supports.
  • ManufacturerA product brand. Manufacturers have their own pages. More in the glossary →, main image, SEO keyword.

Encoding and separators

Excel with Ukrainian regional settings by default saves CSV files in Windows-1251 encoding with a semicolon as the separator. If the module expects UTF-8, the site will show garbled text instead of names. Save the file as "CSV UTF-8 (comma delimited)", or work directly with XLSX if the module supports it. Also watch barcodes: Excel turns a 13-digit EAN into 4.82E+12 and drops leading zeros. Set the EAN, SKU, and model columns to the "Text" format before pasting data.

How does OpenCart store a product, and why does it affect the import?

A single product in OpenCart is not stored in one database table but in several. The module or script must fill in all the necessary ones. Otherwise the product will formally exist but will not be visible on the storefrontWhat the customer sees: the home page, categories, product page, and cart. More in the glossary →. A detailed schema is described in the article about the product table and related tables. For the import, the most important points are:

  • product: model, SKU, price, quantity, status, image path.
  • product_description: name, description, and meta tags, with a separate row for each language. The language is determined by language_id. How languages and stores are linked is explained in the article on language_id and store_id.
  • product_to_store: store assignment. Without a row with store_id = 0, the product will not appear on the storefront, even if it looks fine in the admin.
  • product_to_category, product_attribute, product_option_value: categories, attributes, and options.
  • seo_url: human-readable URLs. In 3.0 the link is stored as query = 'product_id=123'; in 4.1 it is stored through the pair key = 'product_id' and value = '123'. So a script written for one version will not work on the other without modification.

Import modules usually do not upload images from your computer. Instead, they write to the database the path relative to the image/ folder, for example catalog/products/krosivky-001.jpg. The files themselves must be uploaded in advance via FTP or the hosting file manager to image/catalog/products/. Some modules can download photos from a supplier's direct URL. This is convenient, but it significantly slows down the import when there are thousands of products.

How do you run the first product import step by step?

The procedure is the same for 3.0 and 4.1. Only the location of the module in the menu and its interface differ.

  1. Make a backup of the database and files. The import changes thousands of rows at once, and there is no manual "undo" button. A database backup can be created in System → Maintenance → Backup / Restore. It is more reliable to use the hosting backup; see how to set up and test backups.
  2. Prepare the reference data. Create the languages, base currency, attribute groupA container for attributes: "Main," "Dimensions." More in the glossary →, and, if needed, the category structure. Check whether the module can create missing manufacturers and categories automatically, or whether it requires existing ones.
  3. Install the module via ExtensionsAdditional functionality: a module, a payment or shipping method, a feed, or a theme. They are managed in "Extensions → Extensions." More in the glossary → → Installer, then enable it in Extensions → Extensions by selecting the "Modules" type in the filter. Permissions for your user group are added automatically; other user groups must be granted them in System → Users → User Groups.
  4. Run a test import on 5–10 rows. One row should contain a product with options, another a product without an image, and a third a product with a long name.
  5. Configure the column mapping. Specify which column is the key, and choose a mode: "add only", "update only", or "add and update".
  6. Check the result in the admin and on the storefront. Only after that should you run the full file.

After the test run, find the imported products in the list and open each one.

Product list: check that imported items have a price, quantity, and "Enabled" status
Product list: check that imported items have a price, quantity, and "Enabled" status · OpenCart 4.1.0.4

On the Data tab, compare the model, SKU, price, and quantity with the file. Pay special attention to decimal places and leading zeros in the SKU.

Data tab: model, SKU, price, and quantity must match the row in the file
Data tab: model, SKU, price, and quantity must match the row in the file · OpenCart 4.1.0.4

On the Links tab, check the categories, manufacturer, and most importantly the default store checkbox.

Links tab: categories, manufacturer, and store assignment
Links tab: categories, manufacturer, and store assignment · OpenCart 4.1.0.4

How do you regularly update prices and stock from a file?

The first import is done once, but price and availability updates are needed weekly or daily. Separate rules apply to regular updates.

  • "Update only" mode. This way, a supplier's price list with new items you do not sell will not create hundreds of unnecessary product pages on your site.
  • Update only the necessary fields. If the file contains only the SKU, price, and quantity, the module should not overwrite descriptions, SEO texts, and photos that managers have already refined by hand. Check whether the module skips empty columns or writes empty values to the database.
  • Decide what to do with products missing from the file. Usually they are set to quantity 0 and status "Out of Stock", or they are disabled. Do not delete them: deleting loses search pages and links to old orders.
  • Currency and markup. If the price list is in US dollars or euros, convert prices using your rule (exchange rate plus markup) during the import, not manually in Excel. How to manage prices in a currency directly in OpenCart is covered in the overview of the Multi-Currency Products module.

When there are several suppliers, each with its own file format and different column names, preparing spreadsheets by hand quickly takes hours every week. The Automatic Price List Processing (AOP) module automates this work: the rules are configured once for each supplier. Its features are described in the AOP module overview. If a supplier provides data as an XML feed rather than a spreadsheet, that is a separate topic: importing from XML/YML. For managing quantities after the import, read the article on stock management in OpenCart.

What problems can appear after an import, and how do you find them?

Some problems are visible right away, while others appear a week later as customer complaints. Here is what to check first.

  • Duplicates. The key in the file changed or contained spaces, so the module created new products instead of updating existing ones.
  • The product is in the admin but not on the site. Typical causes: no store assignment, status 0, no name for the current language, or an availability date set in the future.
  • The site does not find new products. The cause may be a cache or a third-party search module with its own index; see why OpenCart search does not find products. A filter with its own index also often needs to be rebuilt after an import.
  • Duplicate or empty SEO URLs. These cause the wrong page to open or a 404 to appear. In 3.0, the SEO keyword must be unique within the store (across all languages); in 4.1, it must be unique within the store and language.
  • The import stops midway. The most common causes are PHP limits on execution time or memory. The exact cause will be shown in the OpenCart error log.

Duplicates and "invisible" products are conveniently found with SQL queries in phpMyAdmin. Replace the prefix oc_ with your own. The queries are the same for 3.0 and 4.1:

-- Товари з однаковою моделлю
SELECT model, COUNT(*) AS cnt
FROM oc_product
GROUP BY model
HAVING cnt > 1;

-- Товари без прив'язки до основного магазину
SELECT p.product_id, p.model
FROM oc_product p
LEFT JOIN oc_product_to_store p2s
  ON (p.product_id = p2s.product_id AND p2s.store_id = 0)
WHERE p2s.product_id IS NULL;

Summary

  • OpenCart 3.0 and 4.1 do not have a built-in import from Excel or CSV. You need a module or a custom script.
  • Half of the success depends on the file: UTF-8, a unique and unchanging key (model or SKU), text format for barcodes, and a period in prices.
  • A product is stored in several tables. Without a store assignment and a name for each language, it will not appear on the storefront.
  • Before importing, make a backup, start with a test of 5–10 rows, and check the result in the admin and on the site.
  • For regular updates, work in "update only" mode and do not overwrite manually refined descriptions.

Once the catalog is loaded, it is worth looking after the quality of the product pages. The materials on a product page that sells and on generating product descriptions with AI can help. Other ways to connect your store with accounting, CRM, and suppliers are collected in the section CRM, Accounting and Import.

FAQ

How many products can I import at once?
It depends on your hosting, PHP limits, and the module. Quality modules process the file in parts, so tens of thousands of rows go through without timing out. On cheap hosting, it is better to split a large file into several smaller ones.
How do I import products with options, such as size and color?
The module must support options for this. Usually each variant is written as a separate row with the same product key, or in one cell using a special template. It is better to create the options and their values in advance in “Catalog → Options”.
Can I import product attributes for filters?
Yes, if the module works with attributes. Attribute names in the file must exactly match those in “Catalog → Attributes”, otherwise duplicates will appear, such as “Color” and “color”.
Are SEO rankings preserved if I re-upload the catalog from scratch?
Only if the same page addresses are kept. Deleting products and recreating them with new IDs and addresses leads to 404 errors and a drop in traffic, so it is better to update the catalog by key rather than re-uploading it.
Can I run the import automatically on a schedule?
Yes, if the module or script supports running via cron and gets the file from a link or from a folder on the server. In 4.1, there are scheduled tasks in the admin for this; in 3.0, cron is usually set up through your hosting.
Was this article helpful?
Thanks for your feedback!

Related articles

Didn't find the answer?

Ask the community: OpenCart developers answer on the forum.

Ask on the forum
We use cookies

We use cookies and similar technologies to improve your experience, analyse traffic, and show personalised ads. Read our Cookie Policy for details.