Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation][Cookbook] How to customize Sylius Checkout? #6538

Merged
merged 7 commits into from
Oct 31, 2016

Conversation

CoderMaggie
Copy link
Member

Q A
Doc fix? no
New docs? yes
BC breaks? no
Related tickets partially #5275
License MIT

@pjedrzejewski pjedrzejewski added the Documentation Documentation related issues and PRs - requests, fixes, proposals. label Oct 25, 2016
--------------------------------------------

This is a common problem for many Sylius users. Sometimes the checkout process we have designed is not suitable for your custom business needs.
therefore you need to learn how to modify it, when you will need to for example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Therefore

@Zales0123
Copy link
Member

Pretty nice for me 👍 But as we've said on today's stand up - we should think about describing some more sophisticated example, as single page checkout, which is quite common use case.

Overwrite routing for Checkout
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unfortunately there is no better way - you have to overwrite the whole routing for Checkout.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trade-off. We can import Sylius routing and redeclare sylius_shop_checkout_address or paste here whole checkout and remove shipping step. Not sure which way is better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After import we would also have sylius_shop_checkout_select_shipping route available and that's wrong. I would say that if we customize checkout it's better to copy the whole routing and have full control over it. Same as we do with the state machine.

Copy link
Contributor

@michalmarcinkowski michalmarcinkowski Oct 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's even described as best practice http://symfony.com/doc/current/bundles/override.html#routing by Symfony.

Copy link
Member

@Zales0123 Zales0123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with rebase request ;)

@pjedrzejewski pjedrzejewski merged commit fcf58c6 into Sylius:master Oct 31, 2016
@pjedrzejewski
Copy link
Member

Thank you Magda! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation related issues and PRs - requests, fixes, proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants