-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
CoderMaggie
commented
Oct 25, 2016
Q | A |
---|---|
Doc fix? | no |
New docs? | yes |
BC breaks? | no |
Related tickets | partially #5275 |
License | MIT |
c97b38a
to
f35e62c
Compare
-------------------------------------------- | ||
|
||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Therefore
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 ;)
f35e62c
to
662d339
Compare
Thank you Magda! :) |