雪猫/akeneo3-snow-bundle

2.0.1 2020-12-09 16:05 UTC

This package is auto-updated.

Last update: 2024-08-29 05:37:48 UTC


README

这是一个自定义的 Akeneo 3 扩展包。

目的

此扩展包提供了一个名为 Snowio 连接器的新的连接器,允许我们仅通过一个工作就导出所有数据。然后它会将这些数据压缩并发送到定义的 snowio 端点。

  • 完整工作导出(产品、产品模型、类别、属性、属性选项、家族和属性组)
  • 部分工作导出(类别、属性、属性选项、家族和属性组)

两个工作都有以下最终步骤:生成元数据、压缩文件、使用 Guzzle 发送到 Snowio。

安装

要在 Akeneo 2 实例上安装此扩展包,请运行以下命令

composer require snowio/akeneo3-snow-bundle

配置阈值检查步骤

Snowio\Bundle\CsvConnectorBundle\Step\CheckThresholdsStep 有一个可注入的导出阈值,并且会将其与之前步骤的读取计数进行比较。

定义类作为参数

parameters:
   ...
   snowio_connector.step.check_thresholds.class: Snowio\Bundle\CsvConnectorBundle\Step\CheckThresholdsStep

为该类创建服务

services:
   ...
   snowio_connector.step.check_threshold.products:
      class: '%snowio_connector.step.check_thresholds.class%'
      arguments:
         - 'check_thresholds'
         - '@event_dispatcher'
         - '@akeneo_batch.job_repository'
         - '%minimum_products_export%'

   snowio_connector.step.check_threshold.attributes:
      class: '%snowio_connector.step.check_thresholds.class%'
      arguments:
         - 'check_thresholds'
         - '@event_dispatcher'
         - '@akeneo_batch.job_repository'
         - '%minimum_attributes_export%'

您需要注入阈值(底部参数)- 这些应该通过 parameters.yml 中的变量进行引用。

在您想要检查的步骤之后添加您的服务,例如


services:
   ...
   snowio_connector.job.full_export:
       class: '%pim_connector.job.simple_job.class%'
       arguments:
           - '%snowio_connector.job_name.full_export%'
           - '@event_dispatcher'
           - '@akeneo_batch.job_repository'
           -
               - '@snowio_connector.step.csv_product.export'
               - '@snowio_connector.step.check_threshold.products'
               - '@snowio_connector.step.csv_variant_group.export'
               - '@snowio_connector.step.csv_category.export'
               - '@snowio_connector.step.csv_attribute.export'
               - '@snowio_connector.step.check_threshold.attributes'
               - '@snowio_connector.step.csv_attribute_option.export'
               - '@snowio_connector.step.csv_family.export'
               - '@snowio_connector.step.csv_attribute_group.export'
               - '@snowio_connector.step.metadata'
               - '@snowio_connector.step.archive'
               - '@snowio_connector.step.media_export'
               - '@snowio_connector.step.post'


Version ^1.4 introduce new parameters in `app/config/parameters.yml` which need to be added on deployment.
```
   media_export_directory: media_export/
   media_export_host: false
   media_export_user: false
   minimum_products_export: 0
   minimum_attributes_export: 0
```