1

Who can help me? Ik have magento 1.6.2.

And an extension uses this code for my layered navigation:

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;
    }

This code generates my url in the layered navigation. But with this code it will also use the translated labels ... so blauw in dutch en blue in english ...

Now i would like to always use the adminlabel for this ...

I know this part should be edited:

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

I tried adminlabel ... but that doesn't work. Can anyone help me with this?

4

1 回答 1

2

嗯,如果您可以在那里编辑代码,请尝试执行以下操作:

foreach ($a->getSource()->getAllOptions(true, true /*get default admin values*/) as $o) {
于 2013-05-06T06:29:58.200 回答