Magento自定义"无结果"搜索页面

Wal*_*ker 3 magento

有没有办法为Magento搜索的"无结果"视图定义自定义模板?

问题是如果没有搜索结果我想使用1 col布局,如果匹配则我想使用2 col.

干杯!

Dre*_*ter 11

我有同样的问题:我讨厌定制'空'页面不容易,即空搜索结果,类别页面和篮子页面.所以我暂时延长了一段时间:https://github.com/drewhunter/EmptyHandles.从本质上讲,它为您提供了3个额外的布局句柄:

  1. catalogsearch_result_index_empty
  2. catalog_category_view_empty
  3. checkout_cart_index_empty

因此,在您的特定情况下,您将在安装模块后使用以下xml在空搜索结果页面上更改模板:

   <catalogsearch_result_index_empty>
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </catalogsearch_result_index_empty>
Run Code Online (Sandbox Code Playgroud)