How can I display the payment method in the success page using a code?
If anyone can help me, it would be great. Thankyou.
Get Payment Method on Success Page Programmatically in Magento 2
magento2order-success-page
magento2order-success-page
How can I display the payment method in the success page using a code?
If anyone can help me, it would be great. Thankyou.
Best Answer
Copy the success.phtml from:
to your theme location:
Now add the following code to your success.phtml
You can also create one block which extends Success block and then create one method which should return the above code.
Note: Use of Objectmanager directly in phtml file is not a good practice. you need to create block and adjust those according to your requirement.
Hope this helps!