Categories

Featured templates

Magento. 如何改变搜索结果页面上的列数

Martin Clarke March 7, 2016
Rating: 5.0/5. From 3 votes.
Please wait...

本教程将向您展示如何在Magento中更改搜索结果页面上的列数.

Magento. 如何改变搜索结果页面上的列数
  1. Connect to your FTP 或访问您的网站文件通过 Cpanel and navigate to app/design/frontend/ / tm / productlistgallery tm_themes / themexxx /模板,其中xxx是你的主题. In this directory locate list.phtml file. 你可以把它编辑进去 cpanel 或者下载它并使用任何文本进行编辑 editor,例如Sublime或notepad++;

    Magento. 如何更改搜索结果页面1的列数
  2. In list.phtml 文件定位以下代码(第155行左右):

    getColumnCount(); ?>
    

    现在将其替换为:

    getColumnCount(); ?>
    

    It will comment out 默认的3列 layout 并启用自定义选项.

  3. 将以下代码添加到刚才在list中替换的代码下面.在php中,代码将设置3列 layout 对于所有页面,其中不是搜索结果页面,搜索结果页面4列:

    getRequest()->getControllerName()=='result' || $this->getRequest()->getControllerName()=='advanced') {
    	美元col_class =“col-sm-3”;
    	} else {
    	美元col_class =“col-sm-4”;
    }
    ?>

    现在定位到列表中.php(大约第163行):

  4. And replace col-sm-4 with:

    它将加载您在本步骤前面的" if "语句中指定的动态类.

  5. 修改完成后,保存文件和 update it on your server. Now navigate to app/design/frontend/ tm_themes / themexxxx /layout/,其中xxx是你的主题. In this directory locate tm_productlistgallery.xml 文件,并以与前一个文件相同的方式开始编辑它:

    Magento. 如何更改搜索结果页2的列数

    在第37-57行找到以下代码:

    
    	
    		
    			
    			
    			
    		
    	
    
    
    	
    		
    			
    			
    
    			
    		
    
    
    	
    

    将其替换为:

    
    	
    		
    			
    			
    			
    			4
    		
    	
    
    
    	
    		
    			
    			
    			
    			4
    		
    	
    

    它将允许搜索页面上的列分为4个,每个包含4个项目.

  6. 现在搜索结果将显示在4列中. 您还可以清除或禁用Magento cache,如果结果仍然显示在4列中.

感谢您查看我们的教程. 现在您知道了如何在Magento中更改搜索结果页面的列数.

请随时查看下面的详细视频教程:

Magento. 如何改变搜索结果页面上的列数
Magento电子商务模板
这个条目被张贴了出来 Magento Tutorials and tagged column, Magento, number, page, results, search. Bookmark the permalink.

Submit a ticket

如果您仍然无法找到关于您的问题的足够的教程,请使用以下链接向我们的技术支持团队提交请求. 我们将在接下来的24小时内为您提供我们的帮助和协助: Submit a ticket