jcadima
4/21/2016 - 10:12 PM

Get Products from a specific Category ID

Get Products from a specific Category ID

<?php

// http://stackoverflow.com/questions/454462/how-to-get-products-from-a-particular-category-in-magento-ecommerce

$products = Mage::getModel('catalog/category')->load(category_id); //put your category id here
       $productslist = $products->getProductCollection()->addAttributeToSelect('*');
       foreach($productslist as $product)
       {
        echo 'price: ' . $product->getPrice() . '<br/>';
       }