我需要为由设置为“用途”的自定义属性过滤的产品创建一个新的视图模板文件。
到目前为止一切顺利,我有一个按可见性列出产品的模板文件:
<?php
$visibility = array(
Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
);
$storeId = Mage::app()->getStore()->getId();
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addOrderedQty()
->addAttributeToFilter('visibility', $visibility)
->setOrder('ordered_qty', 'desc');
?>
如何使此代码查询“目的”?