2017 © Pedro Peláez
 

sylius-plugin checkout-flow-plugin

Checkout flow plugin for Sylius.

image

jrc/checkout-flow-plugin

Checkout flow plugin for Sylius.

  • Saturday, December 2, 2017
  • by javierrodriguezcuevas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Overview

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., (*1)

Installation

$ composer require jrc/checkout-flow-plugin
$ bin/console doctrine:schema:update --force

Add plugin dependencies to your AppKernel.php file:, (*2)

public function registerBundles()
{
    return array_merge(parent::registerBundles(), [
        ...

        new \Jrc\CheckoutFlowPlugin\JrcCheckoutFlowPlugin(),
    ]);
}

Import required config in your app/config/config.yml file:, (*3)

# app/config/config.yml

imports:
    ...

    - { resource: '@JrcCheckoutFlowPlugin/Resources/config/config.yml' }

Import routing in your app/config/routing.yml file:, (*4)


# 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, (*5)

# app/config/config.yml

...

jrc_checkout_flow_plugin:
    sm_paths:
        - 'custom/path/new/checkout/custom_flow.yml'

Custom flow files should have following format:, (*6)

# 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, (*7)

Testing

In order to run Behat suites, execute following commands:, (*8)

$ 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

The Versions