I am overriding the checkout success page, Vendor/Theme/Magento_Checkout/templates/success.phtml
and I want to let the user to know that a confirmation e-mail is send to his/her e-mail address.
Is there any way to show the e-mail address, that the user has filled in the checkout page? I have tried searching for methods like getEmail
but could not find anything.
Best Answer
Overwrite Magento\Checkout\Block\Onepage\Success
Vendor/Module/etc/frontend/di.xml
Vendor/Module/Block/Onepage/Success.php
Now inside your success.phtml
Make sure your template is define inside checkout_onepage_success.xml following way:
That means Magento_Checkout before success.phtml in template attribute.
Clear cache.