在前端获取Magento类别属性

use*_*453 2 php attributes magento categories

我创建了一个我想在前端使用的Category属性.我尝试以与产品相同的方式访问它,但它似乎不起作用.如何在前端显示自定义属性?任何猜测?

谢谢

Jon*_*Day 6

试试这个:

$cat_attr = $this->getCurrentCategory()->getAttributes();
if(array_key_exists('short_description', $cat_attr)):
    $_shortDescription=$cat_attr['short_description']->getFrontend()->getValue($_category);
endif;
Run Code Online (Sandbox Code Playgroud)