egio/magento2-module-attributeimport
最新稳定版本:1.0.0
Composer 安装命令:
composer require egio/magento2-module-attributeimport
包简介
README 文档
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
- 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
- Create the directory:
app/code/Egio/AttributeImport - Download and extract the module contents into the directory
- 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
- Navigate to System > Import > Import Attributes
- Select the attribute you want to update
- Upload your CSV file
- Click "Check Data" to validate the file and preview the attribute options
- 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.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-02