jrc / checkout-flow-plugin
该包已被弃用且不再维护。未建议替代包。
Sylius的结账流程插件。
0.2
2017-12-02 15:32 UTC
Requires
- php: ^5.6|^7.0
- sylius/sylius: ^1.0.0@beta
Requires (Dev)
- behat/behat: ^3.3
- behat/mink: ^1.7
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/context-service-extension: ^0.3
- friends-of-behat/cross-container-extension: ^0.2
- friends-of-behat/performance-extension: ^1.0
- friends-of-behat/service-container-extension: ^0.3
- friends-of-behat/symfony-extension: ^0.2.1
- friends-of-behat/variadic-extension: ^0.1
- lakion/mink-debug-extension: ^1.2.3
- phpunit/phpunit: ^6.2
- se/selenium-server-standalone: ^2.52
This package is not auto-updated.
Last update: 2021-09-24 14:38:17 UTC
README
此插件集成了不同的结账流程与Sylius应用。安装后,您应该能够在您的网店中选择不同的结账流程。
安装
$ composer require jrc/checkout-flow-plugin $ bin/console doctrine:schema:update --force
将插件依赖项添加到您的AppKernel.php文件中
public function registerBundles() { return array_merge(parent::registerBundles(), [ ... new \Jrc\CheckoutFlowPlugin\JrcCheckoutFlowPlugin(), ]); }
在您的app/config/config.yml
文件中导入所需的配置
# app/config/config.yml imports: ... - { resource: '@JrcCheckoutFlowPlugin/Resources/config/config.yml' }
在您的app/config/routing.yml
文件中导入路由
# app/config/routing.yml ... jrc_checkout_flow_plugin_admin: resource: "@JrcCheckoutFlowPlugin/Resources/config/app/routing/admin.yml" prefix: /admin Jrc_checkout_flow_plugin_checkout: resource: "@JrcCheckoutFlowPlugin/Resources/config/app/routing/checkout.yml" prefix: /checkout
配置
添加自定义结账流程文件
# app/config/config.yml ... jrc_checkout_flow_plugin: sm_paths: - 'custom/path/new/checkout/custom_flow.yml'
自定义流程文件应具有以下格式
# custom/path/new/checkout/custom_flow.yml ... custom_flow: choice_label: Name admin choice label route_map: [Sylius doc](http://docs.sylius.org/en/latest/cookbook/shop/checkout.html#adjust-checkout-resolver) state_machine: [Sylius doc](http://docs.sylius.org/en/latest/book/architecture/state_machine.html#state-machine)
如果您创建带有新路由的步骤,请务必将其添加到routing.yml中
测试
为了运行Behat测试套件,请执行以下命令
$ docker-compose up $ docker exec -it checkoutflowplugin_php bash $ composer install $ docker exec -it checkoutflowplugin_php bash $ php tests/Application/bin/console server:run localhost:4444 --docroot=tests/Application/web/ --env test $ docker exec -it checkoutflowplugin_php bash $ php tests/Application/bin/console doctrine:database:create --env test $ php tests/Application/bin/console doctrine:schema:create --env test $ vendor/bin/behat $ vendor/bin/phpunit