0

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?

arielmorry
  • 73
  • 1
  • 7
  • 1
    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... – β.εηοιτ.βε Mar 20 '15 at 16:04
  • 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 Mar 20 '15 at 16:15

2 Answers2

0

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>
  • Thanks for your help. what should I put in {module}.xml file? – arielmorry Mar 20 '15 at 16:29
  • The name of the module. For example, {Namespace}_{Module} would be like Mage_Newsletter or Mage_Checkout, where Newsletter and Checkout are the names of the modules. I would recommend doing the tutorial at this link: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento Alan Storm is a Magento expert and this guide will help you understand the creation and configuration of a module from the ground up. – Jonathan Eltgroth Mar 20 '15 at 18:31
0

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>
piCode
  • 36
  • 3