奇博科 / 比索
Requires
- php: ^7.2
- ext-ctype: *
- ext-iconv: *
- ext-pdo: ^7.2
- padraic/phar-updater: ^1.0
- psr/log: ^1.1
- symfony/cache: 4.3.*
- symfony/config: 4.3.*
- symfony/console: 4.3.*
- symfony/debug: 4.3.*
- symfony/dotenv: 4.3.*
- symfony/finder: 4.3.*
- symfony/flex: ^1.3.1
- symfony/serializer: 4.3.*
- symfony/yaml: 4.3.*
- twig/twig: ^2.10
Conflicts
This package is auto-updated.
Last update: 2024-09-11 08:11:12 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.phar
和 bisous.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
(字符串):属性的类型(有效值有identifier
、text
、text-area
、rich-text
、status
、visibility
、simple-select
、multiple-select
、datetime
、metric
、image
、image-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
(布尔值):指定它时,属性是可作用域的(仅适用于类型text
、text-area
、rich-text
、status
、visibility
、simple-select
、multiple-select
、datetime
、metric
、image
,如果在变体轴属性上使用,将在 Akeneo 中产生错误)localised
(布尔值):指定它时,属性是可本地化的(仅适用于类型text
、text-area
、rich-text
、status
、visibility
、simple-select
、multiple-select
、datetime
、metric
、image
,如果在变体轴属性上使用,将在 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: '_'