致命错误:未找到列:未知列'Attribute_Code'(Magento)

时间:2014-02-08 14:54:35

标签: magento attributes filtering

我有一个自定义模块,请求按属性代码分组的产品集合,但在该类别上激活锚点时出现此错误:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'myattribute' in 'group statement'

我的方法是:

protected function _beforeLoad()
    {
        if ($this->isEnabled()) {
            if ($this->isEnabledFlat()) {
                echo $this->getSelect()->columns(array('e.myattribute_ids' => new Zend_Db_Expr("GROUP_CONCAT(DISTINCT e.color SEPARATOR ',')")))->group('myattribute');

            }

            $this->getSelect()->columns(array('e.myattribute_count' => new Zend_Db_Expr('COUNT(*)')));
        }
        return parent::_beforeLoad();
    }

我做错了什么?

模块说明如下:

http://goo.gl/2bUqXs

1 个答案:

答案 0 :(得分:0)

请检查属性“属性”是否正确添加