Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Product Collections Inquiry Is Not Possible
 
blockhead
Jr. Member
 
Total Posts:  20
Joined:  2008-05-12
 

I have tried all means of getting products on a set of collection. I am realy disappointed that something so simple like getting a list of products from an array of collections was so difficult to do. i was able to do this on other carts with out learning to much and in a matter of hours only. magentos oop is good but why am i having a hard time with this. can anyone please help me out and give me a solution to my problem.

Some one suggested me alot of stuffs but it all didnt work. Nothing worked at all. right now its giving me addCategoryFilter errors. its telling me. “Call to a member function addCategoryFilter() on a non-object “

$_main_categories=$this->helper('catalog/category')->getStoreCategories();
if(
$_main_categories->count()):
    foreach (
$_main_categories as $_main_category):
        if(
$_main_category->getIsActive()):
            if(
$_main_category->getId() == 18){
                   
foreach ($_main_category->getChildren() as $_main_category_sub):
                           echo 
"Category:" $_main_category_sub->getName() . "<br />";
                           
                           
$ary_main_category_sub_products $_main_category_sub->getProductCollection()->addCategoryFilter($_main_category_sub)->addAttributeToSelect('*');
                           
$ary_main_category_sub_products->load();
                           if(
$ary_main_category_sub_products){
                               
foreach ( $products->$ary_main_category_sub_products() as $_main_category_sub_products {
                               
echo "Product:" $_main_category_sub_products->getName() . "<br />";
                               
}
                           }
                
endforeach;
            
}
        
endif;
    endforeach;
endif;
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top