0

我想知道如何检查我们是否有网格或列表

\template\bundle\catalog\product\price.phtml

我想根据模式(网格/列表)设置格式价格,在 list.phtml 中我们可以通过以下方式检查模式类型

<?php if($this->getMode()!='grid'): ?>

但在 price.phtml 中,此方法无效,谢谢您的帮助

4

1 回答 1

0

$_GET['mode'] 将包含模式,如果未设置它是默认模式(取决于您的配置)。如果它不够干净并且您只使用 1 种模式,您可以通过 getStoreConfig 或使用 Mage_Catalog_Block_Product_List getMode() 方法来获得它;)

于 2013-03-01T20:26:05.207 回答