swisspost-yellowcube/magento2-yellowcube

瑞士邮政AG提供的YellowCube的Magento2扩展程序 - 瑞士。

1.0.4 2019-08-13 10:45 UTC

This package is auto-updated.

Last update: 2024-09-13 22:08:52 UTC


README

许可证

此扩展程序根据OSL v.3.0许可。一些类和JavaScript包含MIT许可证。

系统要求

  • Magento CE >= 2.3
  • PHP >= 7.1(由Magento 2.3要求)
  • PHP Soap、DOM库、mbstring
  • 启用并配置了Cron的Magento 2

这依赖于Magento 2.3中的新消息队列组件以异步同步数据。默认为MysqlMq实现,存在已知问题:magento/magento2#21904

或者,将其覆盖以使用RabbitMQ适配器。@todo:定义如何。

商店区域必须设置为YellowCube支持的区域(DE/FR/IT/EN-GB)。

安装

  • composer require swisspost-yellowcube/magento2-yellowcube
  • ./bin/magento module:enable Swisspost_YellowCube
  • ./bin/magento setup:upgrade

为添加MysqlMq补丁

composer require cweagans/composer-patches

# Add inside extra:

        "patches": {
            "magento/module-mysql-mq": {
                " MysqlMq: Use new MessageQueue Config interface, update unit tests #21942": "https://raw.githubusercontent.com/swisspost-yellowcube/magento2-yellowcube/master/21942.diff"
            }
        }
        
composer update --lock


配置

在菜单 商店 > 配置 > 销售 > 运输方式 中启用YellowCube并根据接收到的信息进行配置。

在菜单 商店 > 库存 中,创建一个包含至少自动创建的YellowCube源的库存。

重要:在代码更改和部署之后,必须重新启动magento在cron上自动启动的消息队列处理器。

用户手册/配置手册

@TODO

自定义运输方式

可以在app/etc/config.php中扩展已知的运输方式,例如

    'system' => [
        'default' => [
            'carriers' => [
                'yellowcube' => [
                    'methods' => [
                        'eco' => [
                            'label' => 'PostPac Economy CHANGED',
                            'code' => 'ECO',
                        ],
                        'extra' => [
                            'label' => 'Extra new option',
                            'code' => 'ECO EXTRA',
                            'real_code' => 'ECO',
                            'additional' => 'EXTRA',
                        ],
                    ],
                ],
            ],
        ],
    ],

还可以导出整个配置,然后进行调整。见

自动化测试

要运行测试,请按照https://devdocs.magento.com/guides/v2.3/test/integration/integration_test_execution.html中的步骤操作,设置测试套件为

<testsuite name="YellowCube">
    <directory suffix="Test.php">../../../vendor/swisspost-yellowcube/magento2-yellowcube/Tests/Integration</directory>
</testsuite>