0

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?

1 Answer 1

1

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>
6
  • Thanks but I have a magento 2. I am trying to solve it with a Plugin
    – Th. Schott
    Oct 9, 2016 at 14:54
  • Which Plugin method you tried? Oct 9, 2016 at 15:04
  • No one tried yet, I would like to know where to hook in. I guess I need the method responsable for the ouput on the success page. With the same approach I added an additional message when a product was added to the cart.
    – Th. Schott
    Oct 9, 2016 at 15:16
  • Which Plugin you used for the Product? Oct 9, 2016 at 15:18
  • there in my custom Plugin I use afterSetCustomerDataAsLoggedIn an add a success message
    – Th. Schott
    Oct 9, 2016 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.