Skip to main content
Importing Product Variants

Learn how to import new and update existing product variants.

Olga Tereshina avatar
Written by Olga Tereshina
Updated over 3 years ago

X-Cart built-in import tool allows:

Creating Product Variants via Import

You can use the products.csv file to import product variants into an X-Cart-based store. See the file properties here.

A store admin can get a sample products.csv file by exporting it via the Admin area's "Export" section.

It will be necessary to select "Products" in "What to export" and "All attributes" in the "Export product data with" dropdown. This way, the file will include the fields product variants are built on.

Let's consider a sample products.csv file below.

This file contains info on 3 (three) products:

  • SKU 10000000102 - Samsung Galaxy S6

  • SKU 10000000103 - Apple iPhone 8 Plus

  • SKU 10000000104 - Apple iPhone X

The first product (Samsung Galaxy S6) does not have variants, while the others (iPhone 8 and iPhone X) do.

We've kept only the fields that distinguish a product with variants in the file.

In our sample file, product variants are based on product class attributes. It means that the base fields for product variants creation are:

  • productClass and Capacity, GB (field:class) for iPhone X

  • productClass, Capacity, GB (field:class) and Color (field:class) for iPhone 8

The "productClass" field is the field that defines a product class assigned to a product. "Capacity, GB (field:class)" and "Color (field:class)" are product class attributes that build the base for product variants creation.

If we decide to create variants for Samsung Galaxy S6 based on the same properties, i.e., based on the "Mobile phone" product class and its attributes, it would be necessary for us:

  1. Create a new line for each new variant with the same SKU (10000000102).

  2. Assign the product class to the parent product (productClass = Mobile phone).

  3. Specify the values for the fields that will become the base for the variants' creation.
    We've decided to create variants based on the field Color (field:class).

Below is the file that we obtained as a result.

Now, we can import this file via the "Import" page of the store's Admin area (Catalog -> Import).

Make sure you've selected the "Update existing items" in the "Import mode" dropdown.

After the import process completes, the product properties should be updated:

Updating Price and Quantity of Product Variants

Let us imagine that you have a product SKU 10000000104 "Apple iPhone X," and this product has three variants:

i-phone.png

For example, you need to update the variants info as follows:

  • define a different price for each product variant;

  • set an extra quantity stock for each product variant.

Here's how you can do it:

  1. Use the "Export" section of your store's Admin area (Catalog > Export) to export your existing products:

    export-products.png


    If you need to export only one or several products, select them on the product listing page of your store Admin area (Catalog -> Products) and use the "Export all" button at the bottom of the page:

    export-all.png

  2. Download the resulting export file and import it into your favorite spreadsheet editor.

  3. Edit the file removing the columns whose contents will not be updated. Care not to remove the required columns.


    According to CSV import: Products, the required columns for importing products are sku and name; you must keep these columns.

    Since we are dealing with product variants, you must also keep the "variantID" column OR the columns that correspond with the fields the variants were built on:

    1. [attribute_name](field:product) - if variants were built based on product-specific attributes,

    2. [attribute_name](field:class) - if variants were built based on product-specific attributes and

    3. [attribute_name](field:global) - if variants were built based on global attributes). The values in this column are necessary to identify the specific variants.


    In our sample, we would use the "variantID" field as a variant identifier. As we will update the prices and quantities for variants, you should keep the columns "variantPrice" and "variantQuantity" in addition to the required ones. Now, if you look at the lines presenting the details of the variants of "Binary Mom," you should have something like the following:

    products-csv-variants.png

  4. Adjust the values in the file:

    • For variant ID 10000000104-64, add" 650" in the variantPrice column and "20" in the variantQuantity column.

    • For variant ID 10000000104-128, add" 700" in the variantPrice column and "25" in the variantQuantity column.

    • For variant ID 10000000104-256, add" 750" in the variantPrice column and "15" in the variantQuantity column.
      As a result, your file contents should look like the following:

      products-csv-updated.png

  5. Save the file and re-import it into your store via the "Import" section in your store's Admin area (Catalog > Import).

After the import process completes, you should see the updated prices and stock quantity of the product variants.


Related pages:

Did this answer your question?