Categories

Pacemaker Import Community provides the command import:categories command for the category import.

The individual parts of the file name must match the pattern as followed:
<IMPORT-DIRECTORY>/<PREFIX>_<FILENAME>_<COUNTER>.<SUFFIX>
<IMPORT-DIRECTORY>:

is by default the loation of your working directory <ROOT-DIRECTORY>/var/pacemaker/import/

PREFIX:

The <PREFIX> of the import filename represents the category-import area.

DELIMITER ( _ ):

The mandatory Delimiter ( _ ) for the import filename between <PREFIX> and <FILENAME> is a underscore ( _ ).

FILENAME:

The filename is a autogenerated combination of date and time.

  • As a result, the filename look like category-import_20190608-114344_01.csv.

DELIMITER ( _ ):

The mandatory Delimiter ( _ ) for the structured filename between <FILENAME> and <COUNTER> is underscore ( _ ).

COUNTER:

is a incremental number with two digits starting with 01.

SUFFIX (filename extension):

The Pacemaker Import Community uses the <SUFFIX> .csv as default for the import files.

.OK file:
Bunch import:
  • The Bunch import requires the same predefined filename structure as described.

Your CSV file var/pacemaker/import/category-import_20190608-114344_01.csv is now ready for import.

Unique identifier

  • The unique identifier for the product import is the SKU

  • For categories, it is more complex because Magento uses a string, based on the single category IDs, separated by a slash ( / ), e.g., 1/2/120/1502.

  • Since e.g., the PIM system does not recognize these IDs, the category as a replacement requires a string with the names of the admin store categories instead of the IDs and expects this string in the dedicated table column path.

  • The results in the given values could look like default category/women/tops/hoodies & sweatshirts

  • Often, category names themselves contain a slash ( / )

    • Then the category name must get enclosed with the default appended character, e.g., the double apostrophes ( ")

  • The additional_attribute column of the product import is necessary to ensure that the path can get extracted and the category gets added to the correct parent node

Example: The value for a category path that contains slashes must lokke like this:
"Default Category/Dachdecker- & Spenglerarbeiten/""Kehl-/Traufenanschlüsse & -Belüftungen""/""Trauf-/Lüftungsrollen"""

Columns

The CSV file with the categories for Magento 2 CE/EE consists of the following columns
Column Name Type Mandatory Example Description

store_view_code

varchar

yes

en_US

The specific store view(s) where the category is available

If blank, the category is available at the default store view

attribute_set_code

varchar

yes

default

Assign the product to a specific attribute set or product template based on the product type.

Once the product is created, the attribute set cannot be changed

path

varchar

yes

Default Category/MyCategory

Complete category path, including the root category

name

varchar

yes

My Category

The category name specified here appears in the navigation and is also the name used by customers to identify the category

is_active

int

yes

1

Enable/disable the category

is_anchor

int

yes

1

If the category is flagged as anchor, the category products as well as the products of the subcategories will be listed

include_in_menu

int

yes

1

The category will be included in the menu

use_name_in_product_search

int

yes

1

The category name is used for fulltext search on products

display_mode

varchar

yes

Products only

Choose one of the listed display modes
  • Products only

  • Static block only

  • Static block and products

url_key

varchar

yes

my-category

Unique Category URL key

description

text

no

Some longer text here

The category description will be displayed on the category page

image_path

varchar

no

images/categories/my-category.png

Absolute or relative path to a category image file

meta_title

varchar

no

My Category Name

Category title

Will get rendered in the category page
<title>My category title ...</title>

meta_keywords

text

no

Category Name, Keyword 1, Keyword 2

Category meta keywords

Will get rendered in the category page
<meta name="keywords">keyword 1, keyword 2, ...</meta>

meta_description

text

no

A good Description with SEO relevant content

Category meta description

Will get rendered in the category page
<meta name="description">my custom category description, ...</meta>

landing_page

int

no

2

Unique ID of a CMS block

Will get rendered in the category page

position

int

no

10

Category position in the navigation

custom_design

varchar

no

Magneto Blank

Custom design name used to display the catgory

custom_design_from

datetime

no

10/24/16, 12:36 PM

Start date for the scheduled design update

custom_design_to

datetime

no

10/24/16, 12:36 PM

End date for the scheduled design update

page_layout

varchar

no

1 column

Choose a custom page layout for displaying the category
  • 1 column

  • 2 columns with left bar

  • 2 columns with right bar

  • 3 columns

  • Empty

custom_layout_update

text

no

<referenceContainer name="catalog.leftnav" remove="true"> </referenceContainer>

Custom page layout update in XML format

XML example
<referenceContainer name="catalog.leftnav" remove="true"></referenceContainer>

available_sort_by

text

no

Position,Name

Comma separated product list sortings for the catgory

default_sort_by

varchar

no

Position

Default product list sorting for the category

custom_apply_to_products

int

no

1

If set to 1, the design will also be applied to the products listed in the category

custom_use_parent_settings

int

no

1

Overrides the custom design settings with the parent design settings

filter_price_range

decimal

no

100.00

The layered navigation price steps

created_at

varchar

no

10/24/16, 12:36 PM

Category creation date

updated_at

varchar

no

10/24/16, 12:36 PM

The date when the category has been updated

additional_attributes

text

no

custom_attribute_01=a-value,custom_attribute_02=value-01|value-02

A comma separated list with additional attributes

The attributes must be already available