<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Allan Brown &#187; code</title>
	<atom:link href="http://allanbrown.me/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://allanbrown.me</link>
	<description>Proramming, Magento and me</description>
	<lastBuildDate>Tue, 19 Jan 2010 21:29:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Adding images to magento using code (Programmaticaly)</title>
		<link>http://allanbrown.me/magento/adding-images-to-magento-code-programmaticaly/</link>
		<comments>http://allanbrown.me/magento/adding-images-to-magento-code-programmaticaly/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 15:00:51 +0000</pubDate>
		<dc:creator>Allan Brown</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://allanbrown.me/?p=29</guid>
		<description><![CDATA[How to attach images to a product in Magento, when using code.]]></description>
			<content:encoded><![CDATA[<p>Ive been working on automatically adding products to Magento from a 3rd party XML feed.  Its fairly easy to do, however I couldint find much information on how to attach images to a product, and then how to set a product image as thumbnail, small image and base image.</p>
<p>The code to add an image to a product in Magento is:</p>
<p><code>$product-&gt;addImageToMediaGallery($imagePath, array('image','small_image','thumbnail'),				false,			true,			$productData['data_display_name'] . " " . $productData['data_artist_display_name'] . " " . $productData['data_catalog_number']);</code></p>
<p>It is the <em>array(&#8216;image&#8217;,'small_image&#8217;,'thumbnail&#8217;)</em> which tells Magento that you are wanting to use this image as the small image, thumbnail and base image.</p>
<div class="shr-publisher-29"></div>]]></content:encoded>
			<wfw:commentRss>http://allanbrown.me/magento/adding-images-to-magento-code-programmaticaly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
