How to get the path of downloadable product's file of associated product or group product which was upload during add downloadable product?

How to get the path of  downloadable product's file of associated product or group product which was upload during add downloadable product?

This will return you full path of downloadable product

 $file ='';
$home_url = Mage::helper('core/url')->getHomeUrl();
$static_path = $home_url."media/downloadable/files/links";
$productLinks = $ $product ->getTypeInstance(true)->getLinks($product);

foreach($productLinks as $key=>$val)
{
      $val = trim($productLinks[$key]->link_file);
        if($val!='')
        {
        $file = $val;
        }
        else
        {
        $file = '';
        }
}


echo $file_path = $static_path.$file;

Comments