0

1.5 商店使用目录列表模式“网格(默认)/列表”,但我需要使用“列表(默认)/网格”标记显示*的项目集合。

最好仅为特定标签 ID 启用不同的列表模式,但即使在显示任何标签 ID 时启用此功能,我也可以认为任务已完成。

为了清楚起见,我指的是通过目录视图 /tag/product/list/tagId/#/ URL

实现这一目标的最简单方法是什么?我正在使用第三方主题。

4

2 回答 2

1

对于标记的产品列表页面,模板文件是catalog/product/list.phtml,所以首先将catalog/product/list.phtml 复制为catalog/product/list_tagged.phtml。

现在编辑您的 list_tagged.phtml 并在“$_helper = $this->helper('catalog/output');”下方插入以下代码行 36号线左右。

$this->getChild('toolbar')->setCurrentMode('list');
// this will set your default mode to list mode

现在您需要编辑您的 tag.xml 布局文件并为产品列表块设置模板文件 list_tagged.phtml。

希望这会奏效。

于 2012-12-20T13:34:28.903 回答
1

在您的 list.phtml 中,您可以通过以下方式检查您是否在标签页上

 if(Mage::registry('current_tag'))

或检查控制器名称

<?php Mage::app()->getFrontController()->getRequest()->getControllerName(); ?>
于 2012-12-20T13:34:43.760 回答