Skip to content

Commit

Permalink
Merge pull request Sylius#1816 from torinaki/GH90-Implementing-guest-…
Browse files Browse the repository at this point in the history
…checkout

[Core] [WebBundle] Implemented Guest checkout
  • Loading branch information
Paweł Jędrzejewski committed Sep 17, 2014
2 parents 3cee3af + 3c55f1f commit 2467b1b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ public function getConfigTreeBuilder()
->addDefaultsIfNotSet()
->children()
->scalarNode('driver')->isRequired()->cannotBeEmpty()->end()
->booleanNode('guest_order')
->beforeNormalization()
->ifString()
->then(function($v) { return (bool) $v; })
->end()
->defaultFalse()
->end()
->end()
;

Expand Down
4 changes: 3 additions & 1 deletion DependencyInjection/SyliusOrderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class SyliusOrderExtension extends AbstractResourceExtension
*/
public function load(array $config, ContainerBuilder $container)
{
$this->configure(
list($config) = $this->configure(
$config,
new Configuration(),
$container,
self::CONFIGURE_LOADER | self::CONFIGURE_DATABASE | self::CONFIGURE_PARAMETERS | self::CONFIGURE_VALIDATORS
);

$container->setParameter('sylius.order.allow_guest_order', $config['guest_order']);
}
}
1 change: 1 addition & 0 deletions Resources/config/doctrine/model/Order.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</id>

<field name="number" column="number" type="string" unique="true" nullable="true" />
<field type="string" name="email" column="email" nullable="true"/>

<field name="state" column="state" type="string" />
<field name="completedAt" column="completed_at" type="datetime" nullable="true" />
Expand Down

0 comments on commit 2467b1b

Please sign in to comment.