2014-04-25 63 views

回答

0

要獲得所有產品能見度=目錄搜索,目錄和狀態數=啓用

<?php 
$_category = Mage::getModel('catalog/category')->load(3); // 3 is the category id here 
$_product = $_category->getProductCollection(); 
$_product->setVisibility(array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)); 
$_product->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_ENABLED); 
echo $_product->count(); 

?>

相關問題