In this guide, we see how to import and export a list of your products associated to their categories, using a CSV (comma-separated values) file. This can be helpful if you want to exchange information between Portmoni and other platforms, and to manage a large number of entries using Excel or another tool.

There is a difference between the list of products associated to their categories, and the list of product categories themselves:

  1. The list of products associated to their categories: those are the product categories associated to each of your products. This is what is described in this guide.
  2. The list of product categories: this is the list of all available product categories and sub-categories, as defined in the tab “Edit / add product categories” in your site editor. It is not the purpose of this guide.

In this guide, we cover the following:

Let’s dive into it!

How to export a list of your products associated to their categories from your online store

To export a list of your products associated to their categories from your online store, follow the steps below. Your export file will be created automatically, and you will be able to download and save it to your device.

Steps:

  1. From your Portmoni site editor at https://builder.portmoni.com , go to the “Account” tab
  2. In the “Account” tab, go to the “Import / export your data” section
  3. Click on “Import / Export data from your site
  4. In the “Products” section, click on “Export list of products associated to their categories
  5. You are prompted to select a location to save it on your device. Once done your export file is created and saved to the selected location.

You can find below the description of the format of the CSV file.

How to import a list of products associated to their categories into your online store

To import a list of products associated to their categories into your online store, follow the steps below. You can also find below the description of the format of the CSV file.

Warning: before you start an import, make sure that you have a backup of your data. Importing a CSV file that has errors might cause your products data to be deleted or corrupted. In that case a backup will allow you to restore your products quickly and easily.

Steps:

  1. From your Portmoni site editor at https://builder.portmoni.com , go to the “Account” tab
  2. In the “Account” tab, go to the “Import / export your data” section
  3. Click on “Import / Export data from your site
  4. In the “Products” section, click on “Import list of products associated to their categories
  5. Click “Choose file”, and then select the CSV file that you want to import
  6. Click “Upload file and continue
  7. Your file is uploaded and checked for any errors. If there are errors, a screen is displayed with the error details so that you can fix them and upload the file again.
  8. If the file is correct, a confirmation screen is displayed with the details about the import. Review the details, then if you are satisfied click on “Import products associated to their categories
  9. The products are being updated. During the process, the existing categories and sub-categories of all the products defined in the CSV file are removed, and replaced by the ones defined in the file.
  10. When the process is complete, a confirmation is displayed.

Description of the product categories CSV file

The first line of your CSV file is the column headers that describe the content of each column. Each column is separated by a comma. The first line should look like this:

Product handle,Product name,Category handle,Category name,Sub-category handle,Sub-category name

The following lines (or records) in the file contain data using the same columns in that exact same order.  A line would look like this (and you can find more examples in the CSV file example):

product-example,Product Example,category-1,Category 1,sub-category-1,Sub-Category 1

Here is the description of the different columns:

# Column name Column description
1 Product handle

The handle of the product. For instance the handle for product could be “nice-dress”.

Handles are unique names for each product. They can only contain lowercase letters, dashes and numbers, but no spaces, accents or other characters, including periods.

When a handle in the CSV file matches a handle in your online store, the data in the CSV file is used to update the matching product. If a handle does not match an existing product in your online store, an error is returned.

Should be a string, max 50 characters.

This field is required.

2 Product name

The name of the product, for example “A Nice Dress”.

This field is provided for your information only. It is ignored during the import.

Should be a string, max 100 characters.

This field can be empty.

3 Category handle

The handle of the product category. It should match the handle of an existing product category available in your online store. For instance, the category handle could be “women-clothing”.

To see the full list of available product categories handles, you can export the list of product categories from your site.

Should be a string, max 50 characters.

This field is required.

4 Category name

The name of the product category, for example “Women Clothing”.

This field is provided for your information only. It is ignored during the import.

Should be a string, max 100 characters.

This field can be empty.

5 Sub-category handle

The handle of the product sub-category. It should match the handle of an existing product sub-category from the category defined by the “Category handle” in your online store. For instance, the sub-category handle could be “dress”, which should be a sub-category of the category “women-clothing”.

To see the full list of available product sub-categories handles, you can export the list of product categories from your site.

Should be a string, max 50 characters.

This field is required if the “Category handle” is of a category that has sub-categories. Else it should be empty.

6 Sub-category name

The name of the product sub-category, for example “Dress”.

This field is provided for your information only. It is ignored during the import.

Should be a string, max 100 characters.

This field can be empty.

 

Note: If you use Excel to edit your CSV, then check Excel’s export settings when you export the CSV to ensure that your file uses commas between values.

Example of product associated to its category

A product associated to its category is defined by a row in your CSV. Here is the example of such a row:

nice-dress,A Nice Dress,women-clothing,Women Clothing,dress,Dress

This translates to the following fields:

  • Product handle: nice-dress
  • Product name: A Nice Dress
  • Category handle: women-clothing
  • Category name: Women Clothing
  • Sub-category handle: dress
  • Sub-category name: Dress

Sample CSV file

You can download a sample of CSV file for the list of products associated to their categories to use as a template. Alternatively, you can also export a CSV file from your online store and use it as a template.

Please be aware that the sample file contains examples of product categories. If you use it to create your own import file, then make sure that you remove all the examples from the file.

 

We hope this helps, and please do not hesitate to contact us if you have any question!

Related articles