In magento, all products from a child-category is being displayed on top/parent categories. For example, i have this set of categories:
Fabric
- Cotton
---- Shirts (1)
--------Half Sleeves (5)
So in total i have 6 products, and when i click on fabric, it shows all 6 products along with sub-categories.
I don't want this, i want to only list categories and don't want to pull products from child-categories.
So, i want a method or way that can list only child-categories when i click Fabric. And only list 5 products when i click half-sleeves.
Btw, all of my categories are already set to Is Anchor = NO.
Here is the snippet from app/design/frontend/base/default/template/catalog/category/view.phtml
$_cat = new Mage_Catalog_Block_Navigation();
$curent_cat = $_cat->getCurrentCategory();
$curent_cat_id = $curent_cat->getId();
$parentId=Mage::getModel('catalog/category')->load($curent_cat_id)->getParentId();
$categoryid = $parentId;//$_category->getId();
$category = new Mage_Catalog_Model_Category();
$category->load($categoryid);
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');
$i=0;
foreach ($collection as $_product) {........}
Any ideas?
Many Thanks!