I have been searching for a bit on why I'm getting \n in addresses. I have been searching in the templates, adding lines like

<?php echo str_replace('\\n',' ', $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses))) ?>

but that is just a banded as it's coming out in the emails too. I can't seem to find the root to the issue on this. This is what I see everywhere

enter image description here

Here are some details

  • In the export of the customers the address items don't have the extra \n in from of the address parts
  • It shows up in all output that is html based
  • So far all functions that return the address model outputs with \n when formatted in html
  • shortcodes like {{var order.getBillingAddress().format('html')}} also have the error

Any ideas on how to root this issue out?

  • Do you have a store with this published somewhere ? Also what version and magento is that ?
    – Niloct
    Oct 23, 2015 at 18:22
  • add short code {{var order.billing_address.getFormated(\'html\')}} Oct 23, 2015 at 20:35
  • @Niloct it is upto date version and no it's not visible to the public
    – Quantum
    Oct 24, 2015 at 1:10
  • @PrashantValanda honestly don't see how that would help when it's ` $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses))` if I can't sort it out I'll throw the hail marry though, thank you
    – Quantum
    Oct 24, 2015 at 1:11

1 Answer 1


Check your HTML Address Template

Go to System->Configuration->CUSTOMER->Customer Configuration->Address Templates->HTML and check line endings.

Address Templates

Also you can check event customer_address_format. Maybe some 3rd party extension override address rendering logic.

  • 1
    it was rooted there. Thank you, I swear I checked there but nope they were in there like that. thank you
    – Quantum
    Oct 25, 2015 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.