Enabling HTML in Magento Terms and Conditions

We’ve recently been work­ing with a new E-commerce plat­form called Magento. Its a very pow­er­ful open source prod­uct, with tons of fea­tures, and open source good­ness. We recently ran into an issue where we needed to enable HTML con­tent in the “Terms and Con­di­tions”. The fix was actu­ally quite simple.

Nav­i­gate to app / design / fron­tend / default / yourtem­plate / tem­plate / check­out / 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 post­ing was help­ful. Thanks for stop­ping by.


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

Related Posts:


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

  1. [...] The Pre­vi­ous Post­ing « Enabling HTML in Magento... [...]

Leave a Comment