0
votes

I have 3 text attributes I want to create a custom products filter based on them. The store is selling tires and we want to be able to filter by tire's size (which is those 3 attributes together)

I already implemented the functionality and it works great BUT its core PHP hard coded in layer/view.phtml (and another external file), now I need to take the same code but make it a custom filter integrated in Magento framework.

I tried following this tutorial - http://www.techytalk.info/create-custom-layered-navigation-filter-magento but no lack.

so far I created a new module but it doesn't seem to show up in the frontend (I do see it the advanced section in the backend).

I think the main problem right now is the config.xml file:

<config>
<global>
    <models>
        <Companyname_Modulename>
            <class>Companyname_Modulename_Model</class>
        </Companyname_Modulename>
    </models>

    <blocks>
        <Companyname_Modulename>
            <class>Companyname_Modulename_Block</class>
        </Companyname_Modulename>
    </blocks>

    <helpers>
        <Companyname_Modulename>
            <class>Companyname_Modulename_Helper</class>
        </Companyname_Modulename>
    </helpers>

</global>

Any insights?

2
Why would you possibly do a module for that when it is a built in functionality on Magento ? Just add the right attribute on your attribute set, set it correctly for all your product, configure the attribute to be displayed in the layered navigation and you are good to go... - β.εηοιτ.βε
Maybe I haven't explained everything - this is not a built in functionality. the 3 attributes are text attributes (and must remain text attributes because of the out ERP integration, its complicated), each text attribute sets the others, kind of like year, make, model extensions. - arielmorry

2 Answers

0
votes

I think you're missing the <frontend> options in config.xml.

<config>
  <frontend>
    <layout>
      <updates>
        <{namespace}_{module}>
          <file>{module}.xml</file>
        </{namespace}_{module}>
      </updates>
    </layout>
    <router>
      <{module}>
        <use>standard</use>
        <args>
          <module>{Namespace}_{Module}</module>
          <frontName>{module}</frontName>
        </args>
      </{module}>
    </router>
  </frontend>
</config>
0
votes

Do you have the module declaration in the config node of your config.xml file?

<config>
    <modules>
        <Companyname_Modulename>
            <version>x.x.x</version>
        </Companyname_Modulename>
    </modules>
...
</config>