I have been working on our site to download the images for specific SKUs. I am fetching the images like following
require('../app/Mage.php');
Mage::init();
$sku = $_REQUEST['sku'];
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
$_images = $product->getMediaGalleryImages();
$url = array();
if(empty($_images))
die();
foreach ($_images as $image) {
$url[] = str_replace('https:' , 'http:',$image->getUrl());
}
echo implode("|||" , $url);
It works well for the enabled products, but images for disabled products can't be fetched using this snippet. Can anybody help me out to load disabled product images by SKU?