Remove Html tags in magento

If you want to remove <br/> tags from product description page .
than Goto

/app/design/frontend/base/default/template/catalog/product/view/description.phtml
copy description file in you're local theme (template).
app/design/frontend/default/<theme name>/template/catalog/product/view/description.phtml
open local folder description.phtml file and delete "nl2br" tag .

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($this->getProduct()->getDescription()), 'description') ?>

After Remove nl2br tag . the code is

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $this->getProduct()->getDescription(), 'description') ?> 

If you want to remove html tag form other place than use this
strip_tags()          // for PHP
$this->stripTags // For Magento

1 comment: