奇博科/比索

此包的最新版本(v1.0.3)没有可用的许可信息。

安装: 2

依赖: 0

建议者: 0

安全: 0

星标: 5

关注者: 5

分支: 0

开放问题: 3

类型:项目

v1.0.3 2019-11-11 18:10 UTC

README

此工具箱帮助生成由 Akeneo 的 InstallerBundle 消费的 CSV 固定值,来自 Magento 1.9CE 或 1.14EE 目录数据。

此包旨在帮助您将 Magento 目录导入到新的 Akeneo 实例。它并不旨在每天同步 Akeneo 和 Magento。

请注意,此工具将重置您所有现有的 Akeneo 产品数据,并丢失。

支持的属性类型

如何开始

使用 Composer 安装

您主要需要在您的环境中安装此工具

composer global require kiboko/bisous

完成后,在您的 Akeneo 环境中打开一个终端。您需要创建一个 .env 文件,并正确设置以下环境变量

  • APP_DSN=mysql:host=mysql;dbname=magento,Magento 的数据库连接 DSN,请参阅 PDO MySQL 数据源名称
  • APP_USERNAME=root,Magento 的 MySQL 用户名
  • APP_PASSWORD=password,Magento 的 MySQL 密码

然后您需要在此目录中创建一个 catalog.yml 文件,描述您的目录结构。请参阅 The catalog.yml file

从 GitHub 下载 phar

前往 最新版本下载页面,下载 bisous.pharbisous.phar.pubkey 文件。

或者您可以通过这种方式安装文件

curl -L https://github.com/kiboko-labs/bisous/releases/download/v1.0.0/bisous.phar --output /usr/local/bin/bisous
curl -L https://github.com/kiboko-labs/bisous/releases/download/v1.0.0/bisous.phar.pubkey --output /usr/local/bin/bisous.pubkey
chmod 0755 /usr/local/bin/bisous

运行工具

正确安装后,运行 bisous magento <akeneo-directory>/src/InstallerBundle/Resources/fixtures/default

此命令将创建 Akeneo 所需的固定值文件,包含您的 Magento 目录数据和结构。

可用命令

配置命令

  • init 从 Magento 配置创建初始配置文件。
  • test 测试配置文件的语法。

测试命令

  • fake-medias 从 products.csv 和 product_models.csv 文件生成假或最小图像文件。

固定值生成命令

  • magento 根据您的 catalog.yaml 配置和 Magento 数据生成固定值文件。
  • magento:attribute-options 同上,但仅属性选项
  • magento:attribute-groups 同上,但仅属性组
  • magento:attributes 同上,但仅属性
  • magento:channels 同上,但仅渠道
  • magento:families 同上,但仅家族
  • magento:locales 同上,但仅地区
  • magento:products 同上,但仅产品

内部命令

  • help 显示命令帮助
  • list 列出所有可用命令
  • self-update 更新 bisous 命令到最新版本

catalog.yml 文件

catalog.yml 文件有一个根节点名为 catalog:,以下段落中描述了5个子节点

attributes: 部分

此部分用于描述您的属性列表。它是一个配置字段数组,具有以下字段

  • code(字符串):您的属性代码,如在 Akeneo 中看到的那样
  • type(字符串):属性的类型(有效值有 identifiertexttext-arearich-textstatusvisibilitysimple-selectmultiple-selectdatetimemetricimageimage-gallery-item
  • strategy(字符串):导入策略,遵循以下可能值
    • ad-hoc:属性将在 Akeneo 中以与在 Magento 中创建相同的方式创建
    • aliased:属性将在 Akeneo 中以不同于 Magento 中存在的代码创建
    • ex-nihilo:属性将在 Akeneo 中创建,不考虑 Magento 中存在的任何属性
  • group(字符串):属性将在 Akeneo 中分配到的属性组
  • source(字符串)(仅适用于策略 aliased):Magento 中的属性代码
  • position(字符串)(仅适用于属性类型 image-gallery-item):在 Magento 媒体库中的图像索引
  • scoped(布尔值):指定它时,属性是可作用域的(仅适用于类型 texttext-arearich-textstatusvisibilitysimple-selectmultiple-selectdatetimemetricimage,如果在变体轴属性上使用,将在 Akeneo 中产生错误)
  • localised(布尔值):指定它时,属性是可本地化的(仅适用于类型 texttext-arearich-textstatusvisibilitysimple-selectmultiple-selectdatetimemetricimage,如果在变体轴属性上使用,将在 Akeneo 中产生错误)

示例

catalog:
  attributes:
    - code: sku
      type: identifier
      strategy: ad-hoc
      group: general
    - code: name
      type: text
      strategy: ad-hoc
      group: marketing
      scoped: true
      localised: true
    - code: variation_name
      type: text
      strategy: ex-nihilo
      group: marketing
      scoped: true
      localised: true
    - code: weight
      type: metric
      strategy: ad-hoc
      group: logistics
      metric:
        family: Weight
        unit: KILOGRAM
    - code: image
      type: image
      strategy: ad-hoc
      group: marketing
    - code: alternative_image_1
      type: image-gallery-item
      strategy: aliased
      group: marketing
      source: media_gallery
      position: 1
    - code: alternative_image_2
      type: image-gallery-item
      strategy: aliased
      group: marketing
      source: media_gallery
      position: 2

groups:部分》

本部分描述了将在 Akeneo 中创建的属性组,包含以下字段

  • code(字符串):它将包含 Akeneo 中的属性组代码
  • label(数组):它包含该组的标签映射,键为区域设置 ISO 代码,值为实际标签。

示例

catalog:
  groups:
    - code: general
      label:
        fr_FR: Général
        en_GB: General
    - code: marketing
      label:
        fr_FR: Général
        en_GB: General

families:部分》

示例

catalog:
  families:
    - code: jeans
      attributes: [ name, description, short_description, meta_title, meta_description, status, visibility, image, variation_name, variation_image, variation_description, news_to_date, news_from_date, length, width, color, size ]
      label: name
      image: image
      requirements:
        - scope: america
          attributes: [ name, description, image ]
        - scope: europe
          attributes: [ name, description, image ]
        - scope: france
          attributes: [ name, description, image ]
        - scope: japan
          attributes: [ name, description, image ]
        - scope: china
          attributes: [ name, description, image ]
        - scope: asia
          attributes: [ name, description, image ]
        - scope: amazon
          attributes: [ name, description, image ]
        - scope: ebay
          attributes: [ name, description, image ]
      variations:
        - code: jeans_by_size_and_color
          skuPattern: '{{ parent }}:{{ length }}:{{ width }}'
          level-1:
            axis: [ length, width ]
            attributes: [ variation_name, variation_image, variation_description, news_from_date, news_to_date ]
          level-2:
            axis: [ color ]
            attributes: [ sku, status, visibility ]
        - code: jeans_by_size
          level-1:
            axis: [ size ]
            attributes: [ sku, status, visibility, variation_name, variation_image, variation_description, news_from_date, news_to_date ]

locales:部分》

示例

catalog:
  locales:
    - code: fr_FR
      currency: EUR
      store: 15
    - code: en_GB
      currency: GBP
      store: 21

scopes:部分》

示例

catalog:
  scopes:
    - code: europe
      store: 1
      locales:
        - code: fr_FR
          store: 1
        - code: de_DE
          store: 4
        - code: es_ES
          store: 3
        - code: it_IT
          store: 2
    - code: america
      store: 5
      locales:
        - code: en_US
          store: 5
        - code: en_CA
          store: 8
        - code: fr_CA
          store: 6

codes-mapping:部分》

本部分用于生成属性选项代码。由于这些代码在 Magento 中不存在,我们需要根据默认标签构建它们。

示例

catalog:
  codes-mapping:
    - from: '"'
      to: 'inches'
    - from: 'â'
      to: 'a'
    - from: 'é'
      to: 'e'
    - from: 'è'
      to: 'e'
    - from: '/'
      to: '_'