jrc / checkout-flow-plugin
Checkout flow plugin for Sylius.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:sylius-plugin
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
This plugin integrated different checkout flow with Sylius based applications. After installing it you should be able to choose different checkout flow for your channels in your web store.
Installation
$ composer require jrc/checkout-flow-plugin $ bin/console doctrine:schema:update --force
Add plugin dependencies to your AppKernel.php file:
public function registerBundles() { return array_merge(parent::registerBundles(), [ ... new \Jrc\CheckoutFlowPlugin\JrcCheckoutFlowPlugin(), ]); }
Import required config in your app/config/config.yml
file:
# app/config/config.yml imports: ... - { resource: '@JrcCheckoutFlowPlugin/Resources/config/config.yml' }
Import routing in your app/config/routing.yml
file:
# 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
Configuration
Adding custom checkout flow files
# app/config/config.yml ... jrc_checkout_flow_plugin: sm_paths: - 'custom/path/new/checkout/custom_flow.yml'
Custom flow files should have following format:
# 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)
If you create steps with new routes, don't forget to add it to routing.yml
Testing
In order to run Behat suites, execute following commands:
$ 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