So like alot of other people, im building my first Magento custom module - and im trying to make a list of the products in my store. I have worked most of it out by now, but im having a problem when im trying to retrieve the data from my database.
I have googled to my skin starter to fall off, and i have read (and tried) most of the suggestions on stackoverflow - from older posts.
my current Model class looks like this:
public function getRecentProducts()
{
$categoryID = 4;
$category = Mage::getModel('catalog/category')->load($categoryID);
$productCollection = Mage::getResourceModel('catalog/product_collection')
->addCategoryFilter($category);
//$test = Mage::getModel('catalog/product')
// ->getCollection->()addAttributeToSelect('*');
return $products;
}
I checked to make sure i get the correct category with xdebug, and its defently the category im looking for - but sadly thats where it stops to work :( No matter what i try, when i try to retreieve products it returns the array with _data = Null (using the //$test returns exactly the same
I hope somebody can help me, because im about to go crazy from this
P.s i reindexed all the index's, and tried to delete the caches aswell - neither helps