Exporting
Get a CSV out of Craft Commerce so you can edit it in a spreadsheet and reimport.
Two ways to export#
- One product at a time: from the product edit page, for editing one product’s variants in a spreadsheet.
- Many products at once: from Commerce -> Products, using a selection action, for catalog-wide updates.
Exporting one product#
- Commerce -> Products and open the product you want to export.
- In the right-hand sidebar at the bottom of the edit page, click Export Product.
- The file downloads automatically as
{id}__{slug}.csv(for example42__classic-tee.csv).
That filename is important: when you reupload it, Variant Manager uses the {id} part before __ to match the file back to the same product even if you have renamed the product since exporting. The title in the file then overwrites the new title, because every import writes the first cell of row 2 onto the product. Before reimporting an export taken before a rename, edit that cell. Do not rename the file before reuploading.
Exporting many products#
- Commerce -> Products.
- Filter or search to narrow the list. Add a filter offers one entry per attribute, such as Variant Attribute: Size.
- Select the products you want to export. Use the checkbox in the table header to select everything visible.
- Open the actions menu and choose Export Variant Data.
Variant Manager exports one CSV per selected product:
- One product: a single CSV downloads, named the same way as the single-product export.
- Multiple products: a zip downloads, named
products_{YmdHis}.zip(for exampleproducts_20260513142301.zip). Each CSV inside is named{id}__{slug}.csv.
What is in the exported CSV#
Variant Manager writes each CSV so you can edit cell values and reimport it unchanged.
Column order:
- Product fields from
productFieldMap(title, slug, status, plus any custom fields). - Variant fields from
variantFieldMap(sku, height, width, length, weight, and so on). - Per-site Commerce variant fields suffixed with
[siteHandle](basePrice[default],inventoryTracked[default],availableForPurchase[default],freeShipping[default],promotable[default],minQty[default],maxQty[default]), one column per site in the Craft install, not only the sites in this product’s store. A site the product doesn’t exist on gets empty cells. - Inventory columns for each inventory location, all six totals per location (
Inventory[location]: reserved,damaged,safety,qualityControl,committed,available). - Variant Attribute columns prefixed with
Attribute:, one per attribute name any of the product’s variants stores. A variant that does not store a given attribute gets an empty cell in that column.
A few notes on the export content:
- The first row after the header is the product row. It has the product’s title, slug, status, and any product field values.
- Each following row is one variant.
- Disabled products and disabled variants are both exported.
statusis a product column and readsdisabledfor a disabled product; removing itsproductFieldMapentry skips the column. - The export omits a variant’s enabled state unless
variantFieldMaphas'enabled' => 'enabled'. - Variants with
inventoryTrackedon get their inventory totals filled in; untracked variants have empty cells in the inventory columns. - The
stockcolumn, if you have it mapped, is left empty for tracked variants, because Commerce’s inventory levels manage stock instead.
To change the field maps, see configuration reference.
Editing and reimporting#
Steps:
- Export the product or products.
- Open the CSV in your spreadsheet app.
- Edit values. Add new variant rows for new variants; delete rows for variants you want removed.
- Save the file. Keep the original filename (
{id}__{slug}.csv). - Upload from Variant Manager -> Dashboard -> Upload Product.
When you reupload an existing product:
- The modal reads the ID prefix and asks whether to Update & remove extra variants (default) or Replace all variants.
- Choose Update & remove extra variants for the round-trip workflow. Any variant whose SKU is in the CSV gets updated; any variant whose SKU is missing gets deleted.
For the difference between the two, see importing.
Common mistakes#
- Renaming an export file: do not. A rename drops the ID prefix, so the import creates a new product and fails with “One or more SKUs already exist”. See the filename rules.
- Editing column headers: do not rename the column headers. The plugin maps columns by header text; changing
basePrice[default]toPriceleaves prices unchanged on reimport. - Reordering columns: safe for every column except the first. The plugin matches columns by header, but the product title is read from the first cell of row 2 whatever its header says, so moving another column in front of
titlerenames the product on reimport. - Adding new attribute columns: safe. Add a new
Attribute: Materialcolumn with values and reimport. - Removing attribute columns: leaves those attributes on existing variants. Replace all variants creates the variants again without them.
- Adding a row with a new SKU: creates a new variant on reimport.
- Removing a row: deletes that variant on reimport, under the default variant-handling choice.