vml / magento2-module-customerimport
通过 CSV & JSON 导入客户
Requires
- php: >=7.3.0
- magento/module-customer: 103.0.*
- magento/module-customer-import-export: 100.4.*
README
使用 cron 命令以 CSV 或 JSON 格式导入客户
Magento2 模块 Vml CustomerImport
``vml/magento2-module-customerimport``
主要功能
使用 cron 命令导入客户,通过 CSV 或 JSON 格式。
安装
类型 1:Zip 文件
-
解压缩 zip 文件到
app/code/Vml/CustomerImport
-
通过运行
php bin/magento module:enable Vml_CustomerImport
启用模块 -
运行 Magento 命令,运行以下命令
php bin/magento set:upg && php bin/magento set:d:c && php bin/magento set:s:d -f && php bin/magento c:c && php bin/magento c:f
-
通过运行
chmmod -R 0777 var/ pub/
将var
和pub
文件夹的权限设置为 777
类型 2:Composer
-
通过运行
composer require vml/magento2-module-customerimport
安装模块 composer -
通过运行
php bin/magento module:enable Vml_CustomerImport
启用模块 -
运行 Magento 命令,运行以下命令
php bin/magento set:upg && php bin/magento set:d:c && php bin/magento set:s:d -f && php bin/magento c:c && php bin/magento c:f
-
通过运行
chmmod -R 0777 var/ pub/
将var
和pub
文件夹的权限设置为 777
功能
从命令行终端创建来自 CSV 或 JSON 文件的客户。
配置
bin/magento customer:import <profile-name> <source>
因此,要从 CSV 和 JSON 分别导入,用户将执行以下操作之一
profile-name
是 'sample-csv' 或 'sample-json'
source
是您在 var/import
文件夹中添加的文件路径名称(例如 'sample.csv' 或 'sample.json')
-
php bin/magento customer:import --help
-
描述:通过 CSV & JSON 导入客户
-
用法:customer:import
-
参数:profile 配置文件名称,例如:sample-csv 或 sample-json source 源路径,例如:sample.csv 或 sample.json
bin/magento customer:import sample-csv sample.csv
bin/magento customer:import sample-json sample.json
运行我们的客户导入脚本后,我们还需要确保重新索引客户网格索引器
`php bin/magento indexer:reindex customer_grid`