Commerce Product CSV Import/Export
Part of the Commerce ecosystem · 354 projects
This module allows you to import and export Drupal Commerce products using CSV files. You can use it to bulk create or update products, including their paragraph and taxonomy fields, and export existing product data back into CSV format. It automatically adapts to your product types and supports various field types, with features like sample CSV generation and batch processing for large files.
Commerce Product CSV Import/Export
Bulk create and update Drupal Commerce products — including their paragraph, taxonomy, file, and image fields — from a CSV file, and export existing products back to CSV. Ideal for catalog migrations, bulk price updates, and keeping product data in sync with an external spreadsheet or PIM.
Features
- No hardcoded columns. The CSV column set is built automatically by introspecting each product type's actual field configuration (and its variation type) at runtime, so the module adapts as fields are added, removed, or changed — for any product type.
- Import and export, per product type. Each Commerce product type gets its own import/export page, reachable from the product collection view.
- Single or multi-variation products. Rows are matched to existing products by SKU. A matching SKU updates that variation; a new SKU creates one. Several new rows can share a grouping token in the
product_idcolumn to create one new product with multiple variations. - Rich field support. Plain text, number, boolean, and list fields; taxonomy term reference fields (terms are created automatically if missing); Commerce product attribute fields; long/rich text fields (HTML preserved); and paragraph reference fields, encoded as pipe- and double-colon-delimited values.
- File and image field support. CSV columns can also target plain
file/imagefields, orentity_referencefields referencing a media bundle whose source is itself a file or image field (covers core's Image, File, Audio, and Video File media types). Each column takes one or more publicly reachable URLs, pipe-separated; the file is downloaded, validated against the field's own allowed extensions and maximum file size, and attached automatically on import — wrapped in a new media entity first when the field targets media. Export renders the same fields back out as public file URLs. - Sample CSV generator. Download a ready-to-edit sample CSV, pre-filled with placeholder values for every supported column on a given product type.
- Batch processing. Imports run through Drupal's Batch API, so large CSV files don't hit PHP timeout or memory limits.
- Inline column documentation. The import form lists every supported column with a description, plus a list of any fields that exist on the product type but aren't supported (and must be managed manually on the product edit form).
Requirements
- Commerce (
commerce_product) - Paragraphs
- Drupal core:
taxonomy,text, andmediamodules
Installation
Install as you would normally install a contributed Drupal module. See Installing Modules for further information.
Configuration
- Enable the module.
- Grant the Import and export products via CSV permission to the appropriate roles at Administration » People » Permissions.
- Go to Commerce » Products and use the Import / Export CSV action link, or visit
/admin/commerce/products/csvdirectly, to choose a product type.
Usage
Exporting
On a product type's import/export page, click Export products to CSV to download every product of that type as a CSV file, or Download a sample CSV for a template with placeholder values and column documentation.
Importing
Upload a .csv file with a header row. At minimum, the header must include sku, title, and price_amount. Additional supported columns depend on the fields configured on that product type and are listed on the import form itself.
- A row whose
skumatches an existing variation updates that variation and its parent product. - A row with a new
skuand a blankproduct_idcreates a new, standalone product. - Several new rows sharing the same arbitrary
product_idvalue (e.g.NEW-1) are grouped into a single new product with multiple variations. - Multi-value fields are pipe-delimited (
value one|value two); paragraph fields encode each item's subfields joined with::, with items separated by|. - Image and document columns take one or more publicly reachable URLs, pipe-separated; each is downloaded and attached to the field on import, whether it's a plain file/image field or a media reference field.
Depends on
Dependencies of the latest stable release
- Commerce Core commerce_product
- Paragraphs
- media Drupal core
- taxonomy Drupal core
- text Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Commerce ecosystem
Most installed first