how to get all images by using below code. I'm only getting single image
<?php
class Affilnow_Module_Model_Product_Api extends Mage_Api_Model_Resource_Abstract
{
public function items($attributes)
{
$catalog = Mage::getModel('catalog/product')
->getCollection()
->addStoreFilter(Mage::app()->getStore()->getId());
$collection = $catalog->addAttributeToSelect("*");
$tempres = array("helloworld");
$tempres = json_encode($tempres);
//var_dump($tempres);
//echo "<xml>helloworld</xml>";
//print_r($collection);
$tempres = json_encode($collection);
//return $tempres;
//exit();
foreach ($collection as $product) {
$product_id = $product->getId();
$assoc_variations = array();
if ($product->isConfigurable()) {
$assoc_products = $product->getTypeInstance(true)
->getConfigurableAttributesAsArray($product);
foreach ($assoc_products as $assoc_product) {
$assoc_variations[] = $assoc_product;
}
}
$result[] = array(
'id' => $product->getId(),
'name' => $product->getName(),
'stock' => $product->isInStock(),
'sku' => $product->getSku(),
'weight' => $product->getWeight(),
'description' => $product->getDescription(),
'image' => $product->getImageUrl(),
'category' => $product->getCategoryIds(),
'price' => Mage::helper('core') -> currency($product -> getPrice(), true, false),
'hasOptions' => $product->isConfigurable(),
'qty' => intval($product->getQty()),
'created at' => $product->getCreatedAt(),
'variations' => $assoc_variations
'additional_images' =>$product->getMediaGalleryImage()
);
}
return $result;
}
}