I am using product collection in my custom phtml file I try to add filter only show in stock product but it will not work
My code :
$currentCategory = Mage::registry('current_category');
$catId =47;
$last = date('Y-m-d', strtotime('+1 days'));
$first = date('Y-m-d', strtotime('-365 days'));
$collection = Mage::getModel('catalog/category')->load($catId)
->getProductCollection()
->addAttributeToSelect('*') // add all attributes - optional
->addAttributeToFilter('status', 1) // enabled
->addAttributeToFilter('visibility', 4) //visibility in catalog,search
->setPageSize(8)
->addAttributeToFilter('updated_at', array(
'from' => $first,
'to' => $last,
'date' => true,
));
$_helper = $this->helper('catalog/output');
?>