I trying to duplicate advanced search forum with some custom attribute, this clone is a filter page so is different from the real advanced search, for do this I copy advanced search form into a template, now I need to replace
$this->getSearchableAttributes();
with my custom attribute, so i try something like this:
$attribute = Mage::getModel( 'eav/config' )->getAttribute( 'catalog_product' , 'formulazione' );
$array[] = $attribute;
but without success, one thing i note that $this in the original form is different from $this inside my template, I think the problem is this but I don't know how to solve it
Best Answer
You will need to extend few advance search classes.
First I believe you already familiar with magento module developing.
Now, you need to add this block file
Now in your module
Change
your_attribute_1
andyour_attribute_2
to your own attribute id.Now, when you call
$this->getSearchableAttributes()
in yourphtml
file it will be showing only your own attributes.Obviously you will need to create a
controller
to show your form and show the result too.Your controller can have these codes only:
Remember you will also need layout file to render your
index
action.