Can we turn the checkout success page into a checkout step in Magento 2?
-
23-12-2020 - |
Question
How can we make the checkout success page part of the regular Magento2 checkout steps?
I like the idea of having a simplified layout with minimal content during the checkout steps. But the confirmation/success page has that same, main layout used by most of the website.
I know that we can build additional checkout steps, i.e: http://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_new_step.html but I don't think it is really what should be done in our case.
At the end, we just want the checkout success page to look like a final checkout step, not to work like one of them.
La solution
You can update the layout for the checkout's success (& failure) pages in your custom theme:
- checkout_onepage_success.xml
- checkout_onepage_failure.xml
Set layout as checkout:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">