0

Hide Ampersand HTML Code Symbol from Magento Attribute Value

February 3, 2012 Magento

How to Fix and Hide Ampersand Symbols from Magento Attribute Value

Latest Magento 1.6 – again – is showing ampersand symbols (html code) of Magento attribute both in admin/backend either in frontend/ product additional information/ layered navigation if attribute is used for filter/ layered navigation. Indeed, it is very annoying to find this minor coding issue in Magento. More ever, if you are using bulk import feature using Magento csv template file – either using default Magento importer or other importer like Magmi which is Magento Mass Importer.

Your Magento attribute value won’t be imported properly even it is fine in your Magento csv template sheet, just because ampersand – “&” is stored for Magento attribute value in admin/backend – database. Even if you are editing it manually through admin area, after saving the values it will be automatically return to ampersand html code.

Example:
Manufacturer attribute:
D & G    —> showing as D & G

Product Type atrribute:
Lens & Kits     —> showsing as Lens & Kits

HOW TO FIX THIS MAGENTO CODING ISSUE:
—————————————————————–

Go and get this file “AttributeController.php” in:
/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php

Find (Line 168):
$label = $helperCatalog->escapeHtml($label)

Replace with this code:
$label = $helperCatalog->stripTags($label)

OTHER MINOR UPDATE IF REQUIRED TO FIX IN THE FRONTEND:
————————————————————————————————

Go and get this file “attributes.phtml” in:
app/design/frontend/default/yourtemplate/catalog/product/view/attributes.phtml

Find:
<th><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>

Replace with this code:
<th><?php echo $this->stripTags($this->__($_data['label'])) ?></th>

Hope these quick and easy solution to fix Magento attribute coding issues will help you. Good Luck!

Incoming search terms:

702
Thanks!
An error occurred!

Related posts:

  1. Hide Empty Value Attribute in Magento Product Additional Information (Frontend)
  2. Magmi is Magento Mass Importer
  3. How to Solve Magento Error 503 Service Unavailable
  4. How to Set Up Comment URL Open in New Window for WordPress

Leave a Reply

Ultrabook notebook tipis harga murah terbaik

Sepeda Motor Injeksi Irit Harga Terbaik Cuma Honda

Honda PGM-FI Sepeda Motor Injeksi