{"id":62,"date":"2011-01-13T00:26:00","date_gmt":"2011-01-13T00:26:00","guid":{"rendered":"http:\/\/www.codeboss.in\/web-funda\/?p=62"},"modified":"2011-01-13T00:26:00","modified_gmt":"2011-01-13T00:26:00","slug":"magento-fetch-all-the-products-under-a-certain-category","status":"publish","type":"post","link":"https:\/\/codeboss.in\/web-funda\/2011\/01\/13\/magento-fetch-all-the-products-under-a-certain-category\/","title":{"rendered":"Magento &#8211; Fetch All The Products Under A Certain Category"},"content":{"rendered":"<p>If you want to fetch all the products under a certain category in Magento, use the below code &#8211;<\/p>\n<pre class=\"brush:php\">$catObj = Mage::getModel('catalog\/category')->load($catId);<br \/>$prodObj = $catObj->getProductCollection()->getData();<br \/><\/pre>\n<p>Here $catId is the id of the category whose product you want to fetch. And $prodObj will return the array of products, each of whose values will be an array like &#8211;<\/p>\n<p>Array(<br \/>[entity_id] => 1<br \/>[entity_type_id] => 4<br \/>[attribute_set_id] => 4<br \/>[type_id] => simple<br \/>[sku] => product-a<br \/>[has_options] => 0<br \/>[required_options] => 0<br \/>[created_at] => 2011-01-12 19:01:24<br \/>[updated_at] => 2011-01-12 19:01:24<br \/>[cat_index_position] => 1<br \/>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to fetch all the products under a certain category in Magento, use the below code &#8211; $catObj = Mage::getModel(&#8216;catalog\/category&#8217;)->load($catId);$prodObj = $catObj->getProductCollection()->getData(); Here $catId is the id of the category whose product you want to fetch. And $prodObj will return the array of products, each of whose values will be an array like&hellip; <a class=\"more-link\" href=\"https:\/\/codeboss.in\/web-funda\/2011\/01\/13\/magento-fetch-all-the-products-under-a-certain-category\/\">Continue reading <span class=\"screen-reader-text\">Magento &#8211; Fetch All The Products Under A Certain Category<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[54,57],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-magento","tag-php","entry"],"_links":{"self":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":0,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"wp:attachment":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}