Attributes

Pacemaker Import Community provides the command import:attributes command for the attribute 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 attribute-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 attribute-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/attribute-import_20190608-114344_01.csv is now ready for import.

Unique identifier

  • The unique identifier for the attribute import is the attribute code

  • The attribute code is a mandatory field available in the column attribute_code on every row of the CSV file

Columns

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

store_view_code

varchar

default

The specific store view(s) for attribute translations

If blank, the row provides the data for the admin store view

attribute_set_name

varchar

Default

Assigning the attribute to a specific attribute set

attribute_group_name

varchar

Product Details

Assigning the attribute to a specific attribute group

entity_type_code

varchar

catalog_product

The entity type code, a attribute is bound to

attribute_code

varchar

my_attribute

The unique attribue code

sort_order

int

1

The attributes sort order in the backend/frontend

attribute_option_values

text

option-01, option-02

A comma (,) separated list with the attribute options and their values

attribute_option_swatch

text

type=1,value=#000000|type=1,value=#d646d6

A pipe (|) separated list with the attribute option swatch configuration (see additional_data column)

attribute_option_sort_order

text

1,2,3

The attribute options sort order in the backend/frontend

attribute_model

varchar

Magento\Catalog\Model\ResourceModel\Eav\Attribute

The model to load the EAV data from

Must be the FQCN of an available class

backend_model

varchar

Magento\Eav\Model\Entity\Attribute\Backend\Datetime

The model to convert the user input

Must be the FQCN of an available class

backend_table

varchar

my_table_name

The table to store the user input

frontend_model

varchar

Magento\Eav\Model\Entity\Attribute\Frontend\Datetime

The model to validate the user input

Must be the FQCN of an available class

frontend_input

varchar

boolean

The frontend input type

Must be one of
  • hidden

  • boolean

  • text

  • select

  • date

  • textarea

  • text

  • multiselect

  • price

  • weight

  • media_image

  • or gallery

frontend_label

varchar

My Custom Label

The attribute label in the admin store

frontend_class

varchar

hidden-for-virtual

A CSS class name

source_model

varchar

Magento\Eav\Model\Entity\Attribute\Source\Table

The model to load the available values

Must be the FQCN of an available class

frontend_input_renderer

varchar

Magento\Rma\Block\Adminhtml\Product\Renderer

Frontend input renderer

Must be the FQCN of an available class

apply_to

varchar

simple, virtual, bundle, downloadable, configurable

A comma (,) separated list with product types the attribute applies to

backend_type

varchar

int

The attributes backend type

Must be one of
  • text

  • varchar

  • decimal

  • int

  • datetime

  • static

is_required

int

0

The attribute value is mandatory

is_user_defined

int

0

Custom user defined attribute

default_value

text

2

The default value of the attribute

Depends on the attribute configuration

is_unique

int

0

The attribute must contain a unique value in the configured context

note

varchar

My custom note

Custom attribute note

The attribute note is not displayed

is_global

int

1

The attribute is global and can be used to create configurable products

is_visible

int

1

The attribute is visible in the backend

is_searchable

int

0

The attribute gets set searchable in frontend

is_filterable

int

0

The attribute is available in the filter navigation

is_comparable

int

0

The attribute is usable in product comparison

is_visible_on_front

int

0

The attribute is visible on the catalog pages in a storefront

is_html_allowed_on_front

int

0

The attribute value allows us to contain HTML code in a storefront

is_used_for_price_rules

int

0

The attribute can be used to create catalog price rules

is_filterable_in_search

int

0

The attribute values can be used to filter the search results

used_in_product_listing

int

0

The attribute values will be rendered in the catalog

used_for_sort_by

int

0

The attribute values can be used to sort the catalog

is_visible_in_advanced_search

int

0

The attribute is visible in the advanced search

position

int

99

Position of the attribute in the layered navigation block

is_wysiwyg_enabled

int

0

The WYSIWYG editor must get enabled to edit the attribute’s value

is_used_for_promo_rules

int

0

The attribute can be used to create promo rules

is_required_in_admin_store

int

0

The attribute must have a value in the admin store

is_used_in_grid

int

0

Is used in the grid

is_visible_in_grid

int

0

Is visible in the grid

is_filterable_in_grid

int

0

Is filterable in the grid

search_weight

float

1

Search weight

additional_data

text

swatch_input_type=visual, update_product_preview_image=0, use_product_image_for_swatch=0

A comma (,) separated list with additional attributes

Is necessary to create Visual Swatch or Text Swatch attributes
The CSV file with the attribute for Magento 2 CE/EE consists of multiple columns
  • For the multi-store import, the backend_type and frontend_input columns must be set with values at the store level, otherwise a validation error will occur and the import process will be aborted.

  • See Multistore Attribute Example