ikuzostudio/rma-plugin

Sylius 的 RMA 插件

安装: 212

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:sylius-plugin


README

RMA 插件

将 RMA 联系页面添加到 Sylius。

/!\ 目前处于 alpha 阶段 /!\

快速入门

$ composer require ikuzostudio/rma-plugin

将插件依赖添加到您的 config/bundles.php 文件

return [
  // ...
  Ikuzo\SyliusRMAPlugin\IkuzoSyliusRMAPlugin::class => ['all' => true],
];

在您的 config/packages/_sylius.yaml 文件中导入所需配置

# config/packages/_sylius.yaml

imports:
  ...
  - { resource: "@IkuzoSyliusRMAPlugin/Resources/config/app/config.yaml"}

config/routes.yaml 中添加路由

# config/routes.yaml

ikuzo_rma_routes:
    resource: "@IkuzoSyliusRMAPlugin/Resources/config/routes.yaml"
    prefix: /{_locale}
    requirements:
        _locale: ^[a-z]{2}(?:_[A-Z]{2})?$

要覆盖现有原因,在您的 config/packages/_sylius.yaml 文件中

# config/packages/_sylius.yaml

ikuzo_sylius_rma:
  reasons:
    damaged: ikuzo_rma.form.reasons.damaged
    wrong_product: ikuzo_rma.form.reasons.wrong_product
    other: ikuzo_rma.form.reasons.other
    ...

将 RMAChannelInterface 添加到 Channel 模型中,并使用 RMAChannelTrait 实现

use Ikuzo\SyliusRMAPlugin\Model\RMAChannelInterface;
use Ikuzo\SyliusRMAPlugin\Model\RMAChannelTrait;

class Channel extends BaseChannel implements RMAChannelInterface
{
    use RMAChannelTrait;
}

创建迁移并运行它

bin/console make:migration
bin/console doctrine:migration:migrate

进入管理员面板,为所需的渠道启用 RMA