If this is a file out of the magento core api you must include this at the top

require_once './app/Mage.php';
$_helper = Mage::helper('catalog/output');

since we are finding the product with id rather than using the this it is frequent to use the above in the file

Getting the product id with get method

$_productId = $_GET["id"];; // product ID 10 is an actual product, and used here for a test
Create the product object with the identified id

$_product = Mage::getModel(‘catalog/product’)->load($_productId); //load the product
optionally you could get sku even for testing purpose if youd like

echo $_product->getSku();//get anything you want using the typical syntax

getting GAllery of product object rray

$galleryData = $_product->getData('media_gallery');

and the final step is which all php developer must know about for each loop to get out ech object from an object array and showing the each object image URL

<?php foreach ($_product->getMediaGalleryImages() as $_image): ?>
<div> <img style="margin-bottom:30px;" src="<?php echo (string)Mage::helper('catalog/image')->init($_product, 'image', $_image->getFile()); ?>" width="1366" height="728" />
<?php endforeach; ?>


  1. Excellent post. I was checking constantly this blog and
    I’m impressed! Extremely useful information specifically the last part 🙂 I care for such info much.
    I was looking for this certain info for a long time.
    Thank you and best of luck.

  2. This is a great tip especially to those fresh to the blogosphere. Brief but very accurate info… Thank you for sharing this one. A must read post!
    스포츠중계Pretty! This was an incredibly wonderful article. Thank you for supplying these details.

  3. Somebody essentially lend a hand to make seriously articles I might state. This is the first time I frequented your web page and so far? I surprised with the analysis you made to make this actual submit amazing. Wonderful task!
    Fantastic website.“부산비비기”
    A lot of useful info here. I am sending it to a few buddies ans also sharing in delicious. And obviously, thank you for your effort!


Please enter your comment!
Please enter your name here