0
votes

I am working with Magento version 1.7.0.2. I have been trying to figure out the best way to add some additional payment information to the "Payment Information" section when viewing an order in the admin. For example I'd like to add the expiration date of the credit card that was processed (similar to how it would appear for a saved CC method).

I do not wish to override Mage/Payment/Block/Info/Cc.php because then the changes would appear in other undesired places as well (like in sales emails for example).

Thanks for taking the time to read my question!

2

2 Answers

1
votes

In magento you have 2 templates for payment info

  1. Display in sales email/frontend

    /app/design/frontend/base/default/template/payment/info/default.phtml

  2. Display in admin area

    /app/design/adminhtml/default/default/template/payment/info/default.phtml

To my knowledge #2 only display on the order detail page in admin, but if not then you could do something like..

 <?php if ($this->isAdmin() && 'sales_order' == Mage::app()->getRequest()->getControllerName()): ?>
     //display expiration date of the credit card
     // call function in  Mage/Payment/Block/Info/Cc.php
     ....
 <?php endif; ?>

To implement isAdmin() see Magento Request - Frontend or Backend?

0
votes

I ended up building a simple extension that creates a new tab on the order page in the admin to display this additional information. I had difficulty getting the info to appear on the main tab for the orders page. So I just created the new tab with the info.