I have these code on my homepage:
list_home.phtml:
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4))
->setOrder('created_at', 'desc')
->setPage(1, 48);
list_featured.phtml:
$preorderAttribute = 'featured';
$preorderValue = 'Yes';
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter($preorderAttribute, array(
'eq' => Mage::getResourceModel('catalog/product')
->getAttribute($preorderAttribute)
->getSource()
->getOptionId($preorderValue)
))
->setVisibility(array(2,3,4))
->setOrder('created_at', 'desc')
->setPage(1, 12);
Both of which are called from the 'home' CMS page with this:
<div class="category-title">
<h1>Best Sellers!</h1>
</div>
<p>{{block type="catalog/product_list" category_id="4" template="catalog/product/list_featured.phtml"}}</p>
<div class="category-title">
<h1>Newest Additions!</h1>
</div>
<p>{{block type="catalog/product_list" category_id="4" template="catalog/product/list_home.phtml"}}</p>
But after some category changes, e.g. adding some categories and moving them in order or descendence, the homepage suddenly gives nothing as you can see.
I'm totally at a loss. Thus far I tried changing category_id to other categories, refreshing the caches, etc. but nothing worked.
The template code in the .phtml files seems fine to me.
Why is this happening? How to fix this?