我想弄清楚如何从Magento的过滤器列表中获取属性代码。Magento:获取属性代码
<?php
$_filters = $this->getFilters();
foreach ($_filters as $_filter)
{
echo $this->__($_filter->getName());
echo $this->__($_filter->getAttributeCode()); # color_name
}
?>
getAttributeCode()不是一种方法。 我想指定每个过滤器在应用程序/设计/前端/预设/默认/模板/目录/层的attribute_code一个CSS类名/ view.phtml
非常感谢。 () $ this - > _ getFilterableAttributes() 函数getFilters()在app/code/core/Mage/Catalog/Block/Layer/View.php中: $ filters [] = $ this- > getChild($属性 - > getAttributeCode().'_滤波器'); – MotionGrafika 2010-02-09 04:36:11