0

There are categories in our store like featured and promotional. I fetch them in frontend by using there category id.Now I have fetch them through REST api.I made all the oauth configuration and set consumer successfully. So I have registered my module and added api2.xml. Added endpoint as /homepage/featured for featured products.

In V1.php

protected function _retrieveCollection() {
    $maincategory = Mage::getModel ( 'catalog/category' )->load ( 192 )->getProductCollection ();
    return $maincategory;
}

It is returning the product's but with less attributes.

enter image description here

How can I fetch all the product's attribute's from any category?

1 Answer 1

0

Use addAttributeToSelect(*)

protected function _retrieveCollection() {
    $maincategory = Mage::getModel ( 'catalog/category' )->load ( 192 )->getProductCollection ()->addAttributeToSelect('*');
    return $maincategory;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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