egio/magento2-module-attributeimport

1.0.0 2025-03-02 23:15 UTC

This package is not auto-updated.

Last update: 2025-07-07 23:26:48 UTC


README

Overview

The Attribute Import module for Magento 2 provides an efficient way to import product attribute options using CSV files.

Features

  • Import attribute options from CSV files
  • Support for multilingual attribute options (store views)
  • Support for swatch attributes (text and visual swatches)
  • Comprehensive validation of import data before processing
  • Detailed logging of import processes
  • Ability to set default attribute options

Installation

Via Composer

  1. Run the following commands in your Magento root directory:
    composer require egio/magento2-module-attributeimport
    bin/magento module:enable Egio_AttributeImport
    bin/magento setup:upgrade

Manual Installation

  1. Create the directory: app/code/Egio/AttributeImport
  2. Download and extract the module contents into the directory
  3. Run the following commands:
    bin/magento module:enable Egio_AttributeImport
    bin/magento setup:upgrade

Usage

CSV Format

For Visual Swatch or Text Swatch Attributes:

attribute_code store_view value swatch sort_order is_default
color admin Red #FF0000 10 1
color EN Red #FF0000
color FR Rouge #FF0000
color admin Blue #0000FF 20 0
color EN Blue #0000FF
color FR Bleu #0000FF

Note:

  • For visual swatches: A hex color code (e.g., #FF0000) or an image URL
  • For text swatches: Any text value

For Dropdown Attributes:

attribute_code store_view value sort_order is_default
size admin Small 10 0
size EN Small
size FR Petit
size admin Medium 20 1
size EN Medium
size FR Moyen

CSV Column Descriptions:

Column Description
attribute_code The internal code of the attribute being updated
store_view admin for default values, or store code for store-specific translations
value The attribute option label
swatch (For swatch attributes only) Any text value or a color hex code/image path
sort_order Determines the option's display order
is_default 1 to set as the default option, 0 otherwise

Admin Interface

  1. Navigate to System > Import > Import Attributes
  2. Select the attribute you want to update
  3. Upload your CSV file
  4. Click "Check Data" to validate the file and preview the attribute options
  5. If validation is successful, click "Import" to process the import

Logs

Import logs are stored in var/log/attribute_import.log and include:

✅ Timestamp of each event
✅ Success and error messages
✅ Detailed validation issues

Requirements

Software Version
Magento 2.4.6
PHP 8.1.27

License

This module is licensed under the MIT License.