在庫切れのアイテムをすべて一覧表示するcmsページを作成しようとしています。
protected function _getProductCollection()
{
$collection = Mage::getModel('catalog/product')->getCollection();
$collection = $this->_addProductAttributesAndPrices($collection)
->addStoreFilter()
->addAttributeToSort('entity_id', 'desc') //<b>THIS WILL SHOW THE LATEST PRODUCTS FIRST</b>
->addAttributeToFilter('stock_status', 0)
->setPageSize($this->get_prod_count())
->setCurPage($this->get_cur_page());
$this->setProductCollection($collection);
return $collection;
}
しかし、それは機能していません。すべてのアイテムが一覧表示されます。qty=0またはis_in_stock=0であるすべてのアイテムをリストする方法は何ですか?