You are here:  » parsing images from productfeed?


parsing images from productfeed?

Submitted by monchou on Wed, 2008-03-19 18:30 in

Hi,

In the tradetracker productfeeds there always is an <imageURL>. I thought it was possible to parse the image, but all I can get is the URL itself.

Do I need to specify another array, or can I echo it here (how?):

foreach( $Data[ 'products' ][ 'product' ] as $Value )
{
echo 'Product: ' . $Value[ 'name' ] . ', ' . $Value[ 'price attr' ][ 'currency' ] . ' ' . $Value[ 'price' ] . '<br /><hr />';
}

I am a noob :-)

Submitted by support on Wed, 2008-03-19 18:34

Hi,

In your myRecordHandler($record) function, if imageURL is in the $record, then you should just be able to access it as normal - but it will just be the Image URL itself:

$record["IMAGEURL"]

(note how it is all uppercase)

When you use this, you need to enclose that URL in the necessary HTML to make the page you are generating display the image, for example:

print "<img src='".$record["IMAGEURL"]."' />";

Hope this helps!
Cheers,
David.

Submitted by monchou on Wed, 2008-03-19 18:55

Thanks for the quick reply! This really helps a lot!