Product by category api in magento

by likhamaram hudda   Last Updated September 13, 2017 14:09 PM

Solution
Just copy and paste work 100% sure i have tested

Please create a any on root file include this file

<?php
    require_once('app/Mage.php');<br>
          umask(0);<br>
          Mage::app();//->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
      $category = Mage::getModel('catalog/category')->load($category_id);<br>
        $collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('*') // select all attributes<br>
        ->addCategoryFilter($category)
         ->load();

    // create foreach 
    foreach ($collection as $product) {

       $description = Mage::getModel('catalog/product')->load($product->getId())->getDescription(); 
       $image = Mage::getModel('catalog/product')->load($product->getId())->getImage(); 

     $resultss[]= array('product_id'=>$product->getId(),'sku'=>$product->getSku(),'name'=>$product->getName(),'description'=>$description,'short_description'=>$product->getShortDescription(),'weight'=>$product->getWeight(),'status'=>$product->getStatus(),'price'=>$product->getPrice(),'special_price'=>$product->getSpecialPrice(),'special_from_date'=>$product->getSpecialFromDate(),'special_to_date'=>$product->getSpecialToDate(),'images_url'=>'https://url.in/media/catalog/product'.$image);

    print_r($resultss);
?>


Related Questions


Substitute based product In Magento

Updated June 18, 2016 08:03 AM

Magento 2: Year wise Product Display on Category Page

Updated October 12, 2016 09:03 AM

Dispaly custom attribute on catalogpage

Updated August 23, 2017 20:09 PM

Get Custom Option Values of a product magento 2

Updated September 24, 2016 09:03 AM