Enabling HTML in Magento Terms and Conditions

We’ve recently been working with a new E-commerce platform called Magento. Its a very powerful open source product, with tons of features, and open source goodness. We recently ran into an issue where we needed to enable HTML content in the “Terms and Conditions”. The fix was actually quite simple.

Navigate to app / design / frontend / default / yourtemplate / template / checkout / onepage / agreements.phtml and change..

38
39
40
41
42
43
44
<div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
    <?php if ($_a->getIsHtml()):?>
        <?php echo $_a->getContent() ?>
    <?php else:?>
        <?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
    <?php endif; ?>
</div>

to..

38
39
40
41
42
43
44
<div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
    <?php if ($_a->getIsHtml()):?>
        <?php echo $_a->getContent() ?>
    <?php else:?>
        <?php echo nl2br($_a->getContent()) ?>
    <?php endif; ?>
</div>

And that’s it. Let us know if this posting was helpful. Thanks for stopping by.


Was this article helpful? Here's a few related articles which may also interest you.


One Comments to “Enabling HTML in Magento Terms and Conditions”

  1. [...] The Previous Posting « Enabling HTML in Magento… [...]

Leave a Comment