bencurio/magento2-module-catalog-import-cli

该包已被废弃且不再维护。未建议替代包。

通过控制台命令导入目录

安装: 10

依赖: 0

建议者: 0

安全: 0

星级: 0

观察者: 0

分叉: 19

开放问题: 2

类型:magento2-module

0.0.3 2023-03-29 14:57 UTC

This package is auto-updated.

Last update: 2023-03-30 16:03:26 UTC


README

控制台命令用于导入目录文件。

安装

$ composer require bencurio/magento2-module-catalog-import-cli
$ php bin/magento module:enable Bencurio_CatalogImportCommand
$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento cache:clean

用法

$ bin/magento catalog:import \
    [-i|--images_path[="..."]] \
    [-p|--entity_type[="advanced_pricing|catalog_product|customer_composite|customer|customer_address|stock_sources"]] \
    [-b|--behavior[="append|add_update|replace|delete"]] \
    [-v|--validation_strategy[="validation-stop-on-errors|validation-skip-errors"]] \
    [-c|--allowed_errors_count[=100]]
    [-s|--field_separator[=","]]] \
    [-m|--multiple_value_separator[=","]]] \
    [-e|--empty_attribute_value_constant[="..."]] \
    [-f|--fields_enclosure] \
csv_file
  • --images_path: (默认 var/import/images) 必须是从您的 Magento 2.x 项目根目录开始的相对路径
  • --entity_type: (默认 catalog_product) 可能的值:advanced_pricingcatalog_productcustomer_compositecustomercustomer_addressstock_sources
  • --behavior: (默认 add_update) 可能的值:appendadd_updatereplacedelete
  • --validation_strategy: (默认 validation-skip-errors) 可能的值:validation-stop-on-errorsvalidation-skip-errors
  • --allowed_errors_count: (默认 10) 指定错误数量以停止导入过程
  • --field_separator: (默认 ,)
  • --multiple_value_separator: (默认 ,)
  • --empty_attribute_value_constant: (默认 __EMPTY__VALUE__)
  • --fields_enclosure: (默认 false) 使用字段封装
  • csv_file: 可以是相对路径或绝对路径到有效的CSV文件

示例

$ bin/magento catalog:import --images_path="." --behavior="add_update" --fields_enclosure mydb.csv