ikuzostudio / rma-plugin
Sylius 的 RMA 插件
v1.4
2022-09-21 13:54 UTC
Requires
- php: ^8.0
- sylius/mailer-bundle: ^1.7
- sylius/sylius: ^1.11
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: 0.12.99
- phpstan/phpstan-doctrine: 0.12.33
- phpstan/phpstan-strict-rules: ^0.12.0
- phpstan/phpstan-webmozart-assert: 0.12.12
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^5.4
- symfony/debug-bundle: ^5.4
- symfony/dotenv: ^5.4
- symfony/intl: ^5.4
- symfony/web-profiler-bundle: ^5.4
- vimeo/psalm: 4.7.1
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