Commerce Product CSV Import/Export
Commerce Product CSV Import/Export
Bulk create and update Drupal Commerce products — including their paragraph and taxonomy 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.
- 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:
taxonomyandtextmodules
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|.