Magento:如何使用catalogsearch/query模型查找没有图像的产品?
这是我的代码:Magento:如何使用catalogsearch/query模型查找没有图像的产品?,magento,search,Magento,Search,这是我的代码: $catalogSearchModel = Mage::getModel('catalogsearch/query')->setQueryText($q); $catalogSearchModelCollection = $catalogSearchModel->getResultCollection(); $catalogSearchModelCollection->getSelect()->limit(5); $results = $catalogSe
$catalogSearchModel = Mage::getModel('catalogsearch/query')->setQueryText($q);
$catalogSearchModelCollection = $catalogSearchModel->getResultCollection();
$catalogSearchModelCollection->getSelect()->limit(5);
$results = $catalogSearchModelCollection->getData();
我应该添加什么才能只查找带有图像的产品?对带有图像的产品使用以下代码
$catalogSearchModel = Mage::getModel('catalogsearch/query')->setQueryText($q);
$catalogSearchModelCollection = $catalogSearchModel->getResultCollection();
$catalogSearchModelCollection->addAttributeToFilter('image', array('neq' => 'no_selection');
$catalogSearchModelCollection->getSelect()->limit(5);
$results = $catalogSearchModelCollection->getData();
我想你的问题的答案可以在。