Skip to main content

Magento 1.4 product-name quotes are converted to html and then escaped

After upgrading from magento 1.3 to 1.4, if your product headings used quotes " " or ampersands & , then magento may convert these into HTML and then escape that HTML counterparts hence showing e.g.:

"Thermo Balance" Tub & Shower Valve Rough In Valve

like:

"Thermo Balance" Tub & Shower Valve Rough In Valve

The fix is to go into "view.phtml" and change:

            <h1 class="product-name">
                <?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getName()), 'name') ?>
            </h1>

to

            <h1 class="product-name">
                <?php echo $this->htmlEscape($_product->getName())?>
            </h1>

or (preferred) try the latest code from /base/default/template/catalog/product/view.phtml

            <div class="product-name">
                <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
            </div>

Comments

Why not only erase the

Why not only erase the "$this->htmlEscape" from the original code? This fixes the double-escaped chars but keeps the original functionality.

THANK YOU MANOO

THANK YOU MANOO

Hi, Thanks for the post. I

Hi,

Thanks for the post.

I have now changes the file - but no changes are seen in the webshop frontend.

I have also tried to rename the view.phtml-file to determine, if I am editing the right file. The shop still works... :s

Is there some kind of cache that needs to be flushed to get this to work?

Post new comment

The content of this field is kept private and will not be shown publicly.