1
我想用下面的查詢,但過濾大部分銷售產品的產品不能正常工作過濾器系列產品由最暢銷的產品在Magento
$category = Mage::getModel('catalog/category')->load($cat_id);
$collection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);
$collection->addAttributeToFilter('city',array('finset' => Mage::getResourceModel('catalog/product')->getAttribute('city')->getSource()->getOptionId($city_name)));
$collection->addAttributeToSelect('*');
$collection->setOrder('ordered_qty', 'DESC');
$collection->setOrder('name', 'ASC');
$collection->getSelect();
請建議什麼,我做錯了上面的查詢?
http://inchoo.net/magento/bestseller-products-in-magento/ – GoatHater