Php magento-使用管理属性

Php magento-使用管理属性,php,magento,attributes,Php,Magento,Attributes,谁能帮我? Ik拥有magento 1.6.2 扩展将此代码用于我的分层导航: public function getAllFilterableOptionsAsHash() { if (is_null($this->_options)) { $hash = array(); $attributes = Mage::getModel('catalog/layer')->getFilterableA

谁能帮我? Ik拥有magento 1.6.2

扩展将此代码用于我的分层导航:

public function getAllFilterableOptionsAsHash()
    {
        if (is_null($this->_options))
        {
            $hash = array();
            $attributes = Mage::getModel('catalog/layer')->getFilterableAttributes();
            foreach ($attributes as $a){
                $code        = $a->getAttributeCode();
                $hash[$code] = array();

                foreach ($a->getSource()->getAllOptions() as $o){
                    if ($o['value']){ // skip first empty
                        $hash[$code][$this->createKey($o['label'])] = $o['value'];
                    }
                }
            }
            $this->_options = $hash;
        }

        return $this->_options;
    }
此代码在分层导航中生成我的url。 但是有了这段代码,它还将使用翻译后的标签。。。所以荷兰语和英语中的蓝色

现在我想一直使用adminlabel来实现这个

我知道这部分应该编辑:

foreach ($a->getSource()->getAllOptions() as $o){
                        if ($o['value']){ // skip first empty
                            $hash[$code][$this->createKey($o['label'])] = $o['value'];

我试过贴标签。。。但这不起作用。有人能帮我吗?

嗯,如果你能在那里编辑代码,请尝试:

foreach ($a->getSource()->getAllOptions(true, true /*get default admin values*/) as $o) {

实际上,Translate函数正在处理视图部分。请在设计文件夹的文件中放入一些代码。