Magento: Search by Product attribute

# create Output.php.search-by-attribute.diff
--- ./app/code/core/Mage/Catalog/Helper/Output.php 2010-10-06 17:13:09.000000000 +0200
+++ ./app/code/local/Mage/Catalog/Helper/Output.php 2010-10-06 17:12:45.000000000 +0200
@@ -111,6 +111,11 @@
'product' => $product,
'attribute' => $attributeName
));
+
+ if ($attributeName != "item" && $attributeName != "description" && $attributeName != "name") {
+ $attributeHtml = "" . $attributeHtml . "";
+ }
+
return $attributeHtml;
}

# add patch
mkdir -p ./app/code/local/Mage/Catalog/Helper
cp -n ./app/code/core/Mage/Catalog/Helper/Output.php ./app/code/local/Mage/Catalog/Helper/Output.php
patch -p2 ./app/code/local/Mage/Catalog/Helper/Output.php < Output.php.search-by-attribute.diff

# 2th solution, extend productAttribute method in ./app/code/local/Mage/Catalog/Helper/Output.php (splited attributes)
public function productAttributeWithSearch($product, $attributeHtml, $attributeName) {
$attributeHtml = $this->productAttribute($product, $attributeHtml, $attributeName);

$result = "";
if ($attributeName != "item") {
$attribute = split(",", $attributeHtml);
foreach ($attribute as $a) {
$result .= "" . $a . " ";
}
} else {
$result = $attributeHtml;
}
return $result;
}

# 3th solutions, rewrite attributes.phtml (attributes.phtml.diff)
--- app/design/frontend/base/default/template/catalog/product/view/attributes.phtml 2010-10-05 17:55:18.000000000 +0200
+++ app/design/frontend/default/default/template/catalog/product/view/attributes.phtml 2010-10-05 17:58:45.000000000 +0200
@@ -44,7 +44,11 @@
<?php foreach ($_additional as $_data): ?>

<?php echo $this->htmlEscape($this->__($_data['label'])) ?>
- <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>
+
+ ">
+ <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>
+

+

<?php endforeach; ?>