3brs/sylius-order-comments-plugin

Sylius 订单评论插件

安装: 0

依赖者: 0

建议者: 0

安全性: 0

星星: 0

关注者: 0

分支: 2

类型:sylius-plugin


README

订单评论插件

功能

  • 在订单详情中创建备注
  • 向订单收件人发送个性化电子邮件

安装

  1. 运行 $ composer require mangoweb-sylius/sylius-order-comments-plugin

  2. 将插件类添加到您的 config/bundles.php

    return [
       ...
       MangoSylius\OrderCommentsPlugin\MangoSyliusOrderCommentsPlugin::class => ['all' => true],
    ];
  3. 将资源添加到 config/packages/_sylius.yaml

    imports:
         ...
         - { resource: "@MangoSyliusOrderCommentsPlugin/Resources/config/config.yml" }
  4. 将路由添加到 config/_routes.yaml

    mango_sylius_order_comments_plugin:
      resource: "@MangoSyliusOrderCommentsPlugin/Resources/config/routing.yml"
      prefix: /admin
  5. 覆盖 @SyliusAdminBundle/Order/Show/_notes.html.twig 中的模板

    ...
     {{ include('@MangoSyliusOrderCommentsPlugin/Admin/_order.html.twig') }}
  6. 创建并运行 doctrine 数据库迁移。

有关如何使用您自己的实体的指南,请参阅 Sylius 文档 - 自定义模型

使用方法

  • 可以从订单详情中添加评论。
  • 如果勾选“发送给客户”复选框,将向客户的电子邮件发送电子邮件。

开发

使用方法

  • 从 .env.dist 创建到 .env 的符号链接或创建您自己的 .env 文件
  • /src 中开发您的插件
  • bin/ 中查看有用的命令

测试

更改后,您必须确保测试仍然通过。

$ composer install
$ bin/console doctrine:schema:create -e test
$ bin/behat.sh
$ bin/phpstan.sh
$ bin/ecs.sh

许可证

此库受 MIT 许可证的约束。

致谢

3BRS 开发
manGoweb 分支。