dtcd27183 2014-07-17 06:35
浏览 70

Magento Custom过滤方法

I am implementing a custom refine search functionality on product list page in magento There are 4 attributes which will be using like color,size etc.

for this i have created a custom module which has a block.

I want to use this block on product list catalog page.

I am trying to put following in catalog.xml in my custom theme

<block type="filter/form" name="filter.form"          template="catalog/navigation/filter.phtml" />

Where filter is my custom module, but somehow it is not working.

Am i going with wrong approch , if yes, Please suggest me the steps to implement custom filtering on product list page.

blocks parts in config.xml

<global>
    <blocks>
        <Webonise_Filter>
            <class>Webonise_Filter_Block</class>
        </Webonise_Filter>
    </blocks>

    <helpers>
        <Webonise_Filter>
            <class>Webonise_Filter_Helper</class>
        </Webonise_Filter>
    </helpers>
</global>
  • 写回答

1条回答 默认 最新

  • duanmengmiezen8855 2014-07-17 10:24
    关注

    I advise you to change your config to :

    <global>
        <blocks>
            <webonisefilter>
                <class>Webonise_Filter_Block</class>
            </webonisefilter>
        </blocks>
    
        <helpers>
            <webonisefilter>
                <class>Webonise_Filter_Helper</class>
            </webonisefilter>
        </helpers>
    </global>
    

    And then you can call your block with :

    <block type="webonisefilter/form" name="filter.form" template="catalog/navigation/filter.phtml" />
    

    The underscore is not always correctly interpreted. The idea is to get the shortcut from you config.xml and use it in your layout.xml. You need to have a block called Webonise_Filter_Block_Form to match webonisefilter/form.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向