How to Remove Credit Card Information From Sales Email in Magento

Another one of those things that should not be included in emails are the credit card details such as expiration date and the last four digits. In a stock implementation of Magento, when sales emails are sent out, the credit card expiration date and last four are included. Once again, this makes no sense, but here is how to remove that information.

  1. Open the file app/design/frontend/default/your_theme/template/payment/info/cc.phtml
  2. Find the lines that read: <?php echo $this->__(’Credit Card Number: xxxx-%s’, $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/><?php echo $this->__(’Expiration Date: %s/%s’, $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?>
  3. Comment this code out, so it looks like this:<!–<?php echo $this->__(’Credit Card Number: xxxx-%s’, $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/><?php echo $this->__(’Expiration Date: %s/%s’, $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?>–>
  4. Save the file.

That’s it. Magically, the credit card info is removed from the sales confirmation emails in Magento.

Comments are closed.