簡體   English   中英

Magento自定義過濾器方法

[英]Magento Custom filter approch

我正在magento的產品列表頁面上實現自定義優化搜索功能。將使用4個屬性,例如顏色,尺寸等。

為此,我創建了一個具有模塊的自定義模塊。

我想在產品列表目錄頁面上使用此塊。

我試圖將以下內容放在我的自定義主題中的catalog.xml中

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

過濾器是我的自定義模塊,但不知何故。

我是否使用錯誤的方法,如果可以,請向我建議在產品列表頁面上實施自定義過濾的步驟。

阻止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>

我建議您將配置更改為:

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

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

然后您可以使用以下命令調用您的代碼塊:

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

下划線並非總是正確解釋。 這個想法是從您的config.xml中獲取快捷方式,並在您的layout.xml中使用它。 您需要一個名為Webonise_Filter_Block_Form的塊來匹配webonisefilter / form。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM