【发布时间】:2014-12-31 16:50:55
【问题描述】:
要求:我们有一堆有图片和没有图片的产品。我们只需要在前端展示带有图片的产品。
我做了什么:我已经尝试了几乎所有的 SO 资源,例如:
Filter products without images on Magento frontend
How can I find all products without images in Magento?
Hide Products without images magento
以及它们的各种组合都没有运气。我认为新版本的 Magento 发生了一些变化。我使用的是 1.8.1.0 版本
有人可以在这里发光吗?
更新:在我的调试中,我发现
->addAttributeToFilter('small_image', array('neq' => 'no_selection'))
确实有效。但是在分层价格过滤器中出现错误。我在想这不是更早的工作。我收到类似于:Magento 1.7 price filter error (Column not found: 1054 Unknown column 'e.min_price' in 'where clause')...
根据Royw对上述问题的回答,我相信,我们需要编辑文件:Mage/Catalog/Model/Layer/Filter/price.php
【问题讨论】:
标签: php magento filtering magento-1.8 product