I'm new to Magento and trying to edit the success page on 1.9x

All I want is to add payment details for some payment methods. If the customer selects BANK TRANSFER, I want My_Block to be shown on the success page (these are the bank transfer details 'My bank account #00000') I would like to apply the same to maybe other payments.

I've tried many statements, but nothing so far.

    <?php if(payment === 'banktransfer'): ?>
    <p><?php echo $this->__('My_block') ?></p>
<?php elseif(payment === 'checkmo'): ?>
    <p><?php echo $this->__('My_block2');?></p> 
<?php else(payment === 'purchaseorder'): ?>
    <p><?php echo $this->__('My_block3') ?></p>
<?php endif; ?>

Any ideas on how to achieve this? Thank you for your help

  • Have you got your solution ?
    – Pawan
    Commented Mar 5, 2018 at 17:57
  • I haven't found a solution yet.
    – Geo
    Commented Mar 6, 2018 at 1:40

1 Answer 1


First you need to get payment method for the last order. You can use below code on success.phtml

<?php if ($this->getOrderId()):?>
    <div class="bank_detail">
    <?php $orderId = $this->getOrderId(); ?>
    <?php $order = Mage::getModel("sales/order")->loadByIncrementId($orderId); //load order by increment id?>
    <?php $paymentCode = $order->getPayment()->getMethod(); ?>

       <?php if ($paymentCode=='checkmo') { 
           echo "whatever you want!";
       } //you can also check for other payment method?>

<?php endif;?>

Explanation: First we load order by its increment id and get payment method from the loaded order. We can check for payment method echo content based on method.

Hope above will help.

  • welcome @Geo, If have any issue, feel free to ask.
    – Pawan
    Commented Mar 7, 2018 at 17:23
  • Great.welcome @Geo
    – Pawan
    Commented Mar 8, 2018 at 4:01

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.