Magento – Magento 2 show additional message on Checkout Success Page

magento2plugin

On the Checkout Success page, I want to show an additional message after Your order is.... I guess I can do that by an after method via plugin but I don't find the right method where to plug in. Can somebody give me a hint?

Best Answer

There is a simple solution for this. We should override the checkout success page in your custom theme: app/design/frontend/{Vendor}/{Theme}/Magento_Checkout/templates/success.phtml.

Or, we can reference the container order.success.additional.info

{Vendor}/{Module}/view/frontend/layout/checkout_onepage_success.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="order.success.additional.info">
            <block class="{Vendor}\{Module}\Block\YourCustomBlock" name="onepage.success.custom" template="your_custom_template.phtml"/>
        </referenceContainer>
    </body>
</page>