Magento - 排除列表中没有图像的产品 - 未知列small_image

时间:2016-01-26 01:53:42

标签: magento filter product

ref:template / catalog / product / list.phtml 我试图从没有图像的Magento列表中过滤所有产品。我在$ productCollection中添加了以下内容:

->addAttributeToFilter('small_image', array('neq' => 'no_selection'))

我收到以下错误: a:5:{i:0; s:2550:" SQLSTATE [42S22]:未找到列:1054未知列' e.small_image'在' where子句'

- The small_image column is included in catalog_product_flat
- I have re-indexed.
- $_product->getSmallImage() returns correctly - image URL or no_selection

1 个答案:

答案 0 :(得分:0)

关于产品系列->addAttributeToFilter('image', array('neq' => 'no_selection'))尝试使用此代替small_image