This code gets contents(images) in a magento store. It is able to fetch images for magento 1.4x – 1.5
I tried it in 1.5.1 and it seems it cannot fetch the images. Is it located in “media/catalog/product” ?
Any help in getting the location of magento 1.5.1 images? Thanks.
<?php
include_once 'app/Mage.php';
umask(0);
Mage::app();
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect('*');
$products->load();
$baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
$myImage = $baseUrl ."media/catalog/product". $product['image'];
?>
Obviously you’ll want to loop over the collection or specify a product ID in your collection for a specific product, I just used an index of [2] for show.
Also no need to load the entire product attributes collection with
*but rather the specific attribute your needing to conserve memory space.