0

My question is pretty simple. I have a collection like below.

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect(array('sku','name','price','thumbnail'));
$collection->setStoreId(1)->addCategoryFilter($categoryObj);

So above code returns all the products from a particular category.

I need to get all the attributes related to this collection, like layered navigation. Our way of generating layered navigation.

My output will be

Array 1 - All the products in the collection

Array 2 - Product related attributes values like below sample

Brands
Nike
Addidas
Under Armour
__________
Gender
Male
Female
Unisex
_________
Age Group
5-10 Years
10-15 Years
Big kids

Please advise

  • can you try Use Flat Catalog Category and Use Flat Catalog Product > yes after reindex and check – Prashant Patel Jul 31 '18 at 11:14
0

You need to try this code.

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
$collection->setStoreId(1)->addCategoryFilter($categoryObj);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.