Commerce > Catalogs > Importing and exporting a catalog > Importing a catalog using CVS files

Importing a catalog using CSV files

You can import and manage some or all of your catalogCommerce: a top-level container for catalog entries such as categories, products, and variants (SKUs). entries (such as productCommerce: various forms of merchandise that you can display and purchase from the public site, including products, variations/SKUs, bundles, packages and dynamic packages.s, variantCommerce: a variant or SKU corresponds to a specific type of product with specific characteristics. For example, a product line of shirts have individual variations/SKUs that include size, color, and collar size.s (SKUStock Keeping Unit; corresponds to a purchasable product with specific characteristics. For example, a product line of shirts has individual variations/SKUs for sleeve size, color, and collar size.s), and packageCommerce: a unit that contains multiple products or variants, with a single unique pricing for the entire package; comparable to an individual SKU because the package item must be purchased as a whole (such as a computer system).s) in bulk using an Excel spreadsheet (CSVcomma-separated values; tabular data in a plain text file separated by the comma character. format) as an alternative to manually creating catalog entries, which can be tedious when dealing with a large amount of catalog data.

  • Import your .csv spreadsheets and create new catalog entries in Commerce Manager.
  • Set your catalog items into a category structure of your choice.
  • Associate one entry with others (for instance a variant/SKU appears within a product or a package).
  • Edit or delete existing catalog items.

The following steps show how to import and set up a new catalog using the CSV import feature.

  1. Choose an existing catalog folder or create a new one (in the Catalog Management system in Commerce Manager) to import the CSV files to.
  2. Create CSV data files (using Excel Spreadsheet, Notepad, for example) with information about your categories, entries, and entry relations.
  3. Create necessary meta fields for the new catalog entries (in the Administration system).
  4. Drag-and-drop the CSV data files to the CSV Import page in Commerce Manager, .
  5. Create a mapping file for each CSV file, which is required to link each column of data in a CSV file to the correct attributes in Commerce Manager.
  6. Import the CSV files and their corresponding mapping files into a specific catalog.
  7. Create entry relations to associate one entry with another (such as package and a product, or a product and a variation/SKU).

CSV file format

CSV files must follow these criteria:

  • The first row should have headers that correspond to different attributes of the data you want to import (e.g., product name, price, description, image file location, and so on).
  • The following CSV file attributes correctly structure your catalog:
    • Code. A unique code to identify each category or entry
    • Name. A unique name for each row of data
    • Entry Type. (for entries only) Each row must contain one of the following five words for the Commerce Manager to correctly recognize its entry type:
      • Variation
      • Product
      • Package
      • Bundle
      • Dynamic Package
    • Parent & Child Entry Code (for entry relations only). A CSV file containing these codes can specify relationships between entries (e.g., display different Variations within a Product). Although, the following attribute is:
    • Action. A command to specify the action that will be taken during the import. useful in creating a hierarchy in your catalog. Choose one of the following options.
      • Insert
      • Update
      • Delete

        Specify an appropriate command for each line of the CSV files. Entering Insert when that data already exists, or Update when no data exists gives an error during import and those lines of data are not successfully imported.

    • Category Code (by comma). By assigning a category code to an entry, you can specify the category that you want to place your entry in.
    • SEO URL. A unique URLUniform Resource Locator. Also known as a web address such as for each item in your catalog.

      An error occurs if you import files that contain more than one identical URL.

Mapping file types

Select the type of mapping file you need.

Commerce Manager displays different sets of Fields and Attributes for each option. You can manually assign the attributes to each data column of your CSV file. The items under Fields and Attributes with superscripts 1 and 2 are headers that are required attributes in the CSV files you are importing (1—required field for Insert, 2—required field for Update).

CSV File type 1—Category file

categoryCMS: a built-in Episerver property, you apply a category to content, but you need to build the functionality to display the filtered results. Commerce: a category is a grouping of purchasable products. (Same as node.) file specifies data for categories or subcategories within a catalog.

  • The top line has column headers that are matched with the metadata fields. The headers also can have different names.
  • Category Code in column 1 is important because it specifies where the entry data is stored.
  • The code entered in under Parent Code in column 2 can be used to create subcategories. If the Parent Code is set to null or rootThe parent of all folders in a file system. (Despite being called the root, it is generally found at the top of the structure.), then that category is created in the root level of a catalog. Figure 1 shows that Infants and Toddlers categories are created at the root level, while the Diapering Supplies category is located under Infants as a subcategory.

CSV File Type 2—Entry files

Entry files specify data for catalog entries. The Products, Variation/SKUS, and Packages CSV files for this example are shown in Figures 2, 3, and 4.

CSV File Type 3—Entry relations file

The entry relations file links one entry to others. In the following example, Var1 through Var5 (different diaper sizes) are associated to Prod1 (Diapers), Var9 through Var11 (different quantity for wipes) are associated with Prod2 (Wipes) and so on. Some variants are assigned to packages.

The Prod, Var and Package codes must be the codes from the entry CSV files (Figures 2, 3, and 4). If you include codes that are not defined in the entry CSV files, an error occurs when they are imported into Commerce Manager.

CSV file type 4—Associations file

The associations file creates associations among different entries. In Figure 6, Var10 is associated to Var1 as an accessory, and Var2 to Var1 as a cross-sell item.

CSV file type 5—Pricing/inventory file

The pricing/inventory file specifies the information for the Pricing/Inventory tab of each individual entry.

CSV file type 6—Sale price file

The Sale price file specifies the information for the Pricing section of the Pricing/Inventory page.

Example: Importing and setting up a new catalog

The following example shows how to use CSV import using the guidelines. Create a new catalog called Baby Stuff in the Catalog Management system.

Step 1: Create CSV files containing data for your new entries

Download the sample CSV files that go with this example Sample Catalog CSV Files.

The following files provide the base for the example:

  • BabyStuffCategories.csv
  • BabyProducts.csv
  • BabyPackages.csv
  • BabyVariations.csv
  • BabyVariationInventoryPricing.csv
  • BabyEntryRelations.csv
  • BabyAssociations.csv
  • BabySalePrice.csv

Step 2: Create necessary meta fields for the new catalog entries

The example files use only default attributes so you do not need to create additional meta fields. If you want to create new meta fields, use the following steps.

  1. Go to the Administration system in Commerce Manager.
  2. Select Catalog System > Meta Classes located in the left navigation frame.
  3. Select Create New > New Meta Class.
    1. Enter in a Name, Friendly Name (e.g., Baby Catalog), and some description (optional) for the meta-class, and choose Catalog Entry for Entry Type.
    2. Click OK to save the new class.
  4. Select Create New > New Meta Field.
    1. Enter in a Name, Friendly Name (e.g., Baby Diaper Size), and some optional description.
    2. Choose the data type for this meta field and other properties by selecting on the check boxes.
    3. Click OK to save the new field.
    4. Repeat the steps to create all the necessary fields.
  5. Associate the new meta fields to the meta-class you created.
    1. Click Meta Classes node on the left navigation frame again.
    2. Select Element > Catalog Entry.
    3. Under Type choose your meta-class (e.g., Baby Catalog) you created earlier.
    4. Select the desired meta fields from the list displayed at the bottom of the screen.
    5. Click OK to save the new meta-class to fields association.
  6. You are done with setting up your meta fields.

Step 3: Upload the CSV data files to the CSV import page

  1. Click Catalog Management.
  2. In the upper-left detail area, select Catalogs. The Catalog List view appears in the main area.
  3. In the action area above the main view, select Import/Export and select CSV Import Catalog. The CSV Import Catalog page appears in the main screen. The screen contains two tabs: CSV Import and Mapping File.
  4. In the CSV Import tab in the main view, drag and drop a file to import from the source location. The CSV file you uploaded is added to the Files available for import list.
  5. Repeat the previous steps for each CSV file you want to upload.

Step 4: Create a mapping file for each CSV file

  1. Select the Mapping file tab in the main view. The Mapping file tab view of the CSV Import Catalog view appears for you to fill in.
  2. Fill in the form fields as follows:
    • Edit existing mapping file section
      • Load mapping file. Retrieves previously created and saved mapping files. Because there is no existing mapping file in this example, leave this section blank.
    • Meta Class, Language section
      • Mapping Type. Select Category w/ Meta Data.
        • For CSV Entry files, select Entry w/ Meta Data.
        • For CSV Entry Relations file, select Entry Relation.
        • For CSV Associations file, select Entry Association.
        • For CSV Pricing/Inventory file, select Variation w/ Inventory.
        • For CSV Sale Pricing file, select Sale Price.
      • Meta Class. Select Default Catalog Node.
      • Language. Select English.
    • Data fle and CSV adjustment section
      • Data File. The drop down values are dependent on the different CSV data files you uploaded on the CSV Import tab in step 2. For this example, select BabyStuffCategory.csv. Leave the rest of the field as default and move on to the next section.
      • Delimiter. Select default value.
      • Text Qualifier: Select default value.
      • Encoding. Select default value.
    • Fields and Attributes, Column headers in the data file, and Custom values section

      The values in the Fields and Attributes column are representative of the Meta Class selected in the MetaClass, Language section (which were either previously imported or created within Commerce Manager).

      The values in the drop-down menus in the Column headers in the data file column are representative of the Data file selected in the Data file and CSV adjustment section (which were previously imported above).

      • Select the appropriate Column header drop-down value to map with the meta-class Fields and Attributes to the left. The value selected is reflected in the Custom values column to the right.
    • Save mapping file section
      • Enter file name. Enter a file name. For this example, save the mapping files using the same CSV file names.
  3. Click Save. The browser returns to the CSV Import tab, and the mapping file in .XML format is added to the list in the Choose mapping file section.
  4. Repeat the steps to create and save a mapping file for each CSV files you want to import.

When all the mapping files are saved, your CSV Import tab screen should look something like Figure 12.

Step 5. Import the CSV files and their corresponding mapping files into a specific catalog

At the CSV Import tab view (Figure 12), do the following:

  1. Select and highlight the CSV file you want to import in the Files available for import section. For this example, select BabyStuffCategories.csv.
  2. Select and highlight the mapping file that corresponds to the selected CSV file in the Choose mapping file for import section. For this example, select BabyStuffCategories.xml.
  3. Select the catalog in the Catalog drop-down into which you want to import your CSV data. In this example, choose Baby Stuff.
  4. Click Start import. The Importing catalog dialog box appears which shows the percentage of completion and logging messages.
  5. Click Close Window to complete the operation.
  6. Repeat the steps to import all the remaining CSV and Mapping pairs.

Step 6. Verify your import

In the Catalog Management system, expand Catalog > Baby Stuff and verify that the contents of your CSV file were imported into the appropriate catalog.

back to top

Episerver User Guide update 16-1 | Released: 2/16/2016 | Copyright © Episerver AB | Send feedback to us