<?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>Mike D&#039;s SharpBlog</title>
	<atom:link href="http://www.sharpdotinc.com/mdost/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharpdotinc.com/mdost</link>
	<description>Just another Sharpdot weblog</description>
	<lastBuildDate>Mon, 26 Jul 2010 13:50:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zend Framework (zf): Multi-Step Form with dynamic Elements</title>
		<link>http://www.sharpdotinc.com/mdost/2010/07/26/zend-framework-zf-multi-step-form-with-dynamic-elements/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/07/26/zend-framework-zf-multi-step-form-with-dynamic-elements/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:50:50 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/uncategorized/"><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=244</guid>
		<description><![CDATA[Coming Soon: Tutorial on how to make a multi-page form and also how to use dynamic elements on the form.
]]></description>
			<content:encoded><![CDATA[<p>Coming Soon: Tutorial on how to make a multi-page form and also how to use dynamic elements on the form.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/07/26/zend-framework-zf-multi-step-form-with-dynamic-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend FrameWork: Join Query Not working</title>
		<link>http://www.sharpdotinc.com/mdost/2010/07/25/zend-framework-join-query-not-working/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/07/25/zend-framework-join-query-not-working/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 02:27:38 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/frameworks/"><![CDATA[FrameWorks]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/category/frameworks/zend-framework/"><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=240</guid>
		<description><![CDATA[While creating a SQL query in ZF I kept getting an error with my joins. I was able to fiz this using the code below.

$fooTable = new DbTable_Foo();
        $select = $fooTable -&#62;select(Zend_Db_Table::SELECT_WITH_FROM_PART);
        $select-&#62;setIntegrityCheck(false)	//Set integrity check is what did the trick for [...]]]></description>
			<content:encoded><![CDATA[<p>While creating a SQL query in ZF I kept getting an error with my joins. I was able to fiz this using the code below.</p>
<p><code><br />
$fooTable = new DbTable_Foo();<br />
        $select = $fooTable -&gt;select(Zend_Db_Table::SELECT_WITH_FROM_PART);</p>
<p>        $select-&gt;setIntegrityCheck(false)	//Set integrity check is what did the trick for me.<br />
        	-&gt;join('foo', 'bar.id = foo.id')<br />
			-&gt;where('foo.id = '.id);<br />
        $fooRowset = $this-&gt;getDbTable()-&gt;fetchAll($select);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/07/25/zend-framework-join-query-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Studio: How to fix Code Completion, when it stops working</title>
		<link>http://www.sharpdotinc.com/mdost/2010/07/25/zend-studio-how-to-fix-code-completion-when-it-stops-working/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/07/25/zend-studio-how-to-fix-code-completion-when-it-stops-working/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 00:33:07 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/uncategorized/"><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=238</guid>
		<description><![CDATA[I have ran into an issue/bug with zend studio/eclipse IDE, every once an a while code completion will stop working. I have not been able to pin down what exactly causes the problem, but here is my fix.
Delete the following file in the Zend Studio workspace:
Zend/workspaces/&#60;your workspace name&#62;/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ui.prefs

]]></description>
			<content:encoded><![CDATA[<p>I have ran into an issue/bug with zend studio/eclipse IDE, every once an a while code completion will stop working. I have not been able to pin down what exactly causes the problem, but here is my fix.</p>
<p>Delete the following file in the Zend Studio workspace:</p>
<pre>Zend/workspaces/&lt;your workspace name&gt;/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ui.prefs
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/07/25/zend-studio-how-to-fix-code-completion-when-it-stops-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Upgrading to 1.4</title>
		<link>http://www.sharpdotinc.com/mdost/2010/06/09/magento-upgrading-to-1-4/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/06/09/magento-upgrading-to-1-4/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:06:36 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/uncategorized/"><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=230</guid>
		<description><![CDATA[This is my upgrading Magento to Version 1.4 journey.
Here is how I decided to go about it.

Backup the database!!
Clear all cache and disable caching
Move code into a SVN Branch (assuming you use source controll, if you don&#8217;t you should!)
Remove Old Core Magento Code (just leave community and local modules, keep my theme folder)
Download Full Release [...]]]></description>
			<content:encoded><![CDATA[<p>This is my upgrading Magento to Version 1.4 journey.</p>
<p>Here is how I decided to go about it.</p>
<ul>
<li>Backup the database!!</li>
<li>Clear all cache and disable caching</li>
<li>Move code into a SVN Branch (assuming you use source controll, if you don&#8217;t you should!)</li>
<li>Remove Old Core Magento Code (just leave community and local modules, keep my theme folder)</li>
<li>Download Full Release from Magento&#8217;s Website(don&#8217;t use the downloader, use the full release!)</li>
<li>Extract the New Release into the SVN Branch that was created earlier</li>
<li>If your template was a sub-template of anther theme then you need to merge them together to use in 1.4. This is due to the fact that 1.4 changed a bunch of classes and layouts. Or you could start from a fresh theme and re code it.</li>
<li>Change the theme to a default theme until you are sure that the update went ok.</li>
</ul>
<p>Errors and Bugs I came across:</p>
<ul>
<li>When Trying to run indexing I got the following error, &#8220;can&#8217;t initialize indexer process&#8221;. This was because I was missing some database tables that failed to install during the upgrade. I installed and ran the database repair tool.</li>
<li>Had to disable WYSIWYG so that page templates did not get messed up.</li>
<li>The file &#8220;catalog/product/list/toolbar.phtml&#8221; changed quite a bit, so if you modified this file grab the new one then start from there. Also the file &#8220;page/html/pager.phtml&#8221; needs to be update the the 1.4 version if you modified this file.</li>
<li>When editing or adding products the Category Tree was only showing the Default or Root Category.<br />
To Fix this I just created a new subcategory of the root catalog and move all the categories into this new category then move them back to there original position. This must rebuild what ever was messed up in the database.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/06/09/magento-upgrading-to-1-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal: Adding Nodes Programaticly using drupal_execute()</title>
		<link>http://www.sharpdotinc.com/mdost/2010/06/04/drupal-adding-nodes-programaticly-using-drupal_execute/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/06/04/drupal-adding-nodes-programaticly-using-drupal_execute/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 14:25:14 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/uncategorized/"><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=228</guid>
		<description><![CDATA[I recently had to migrate data into Drupal. To do this I decided to just run drupal_execute(), to create the nodes. I ran into a few quirks and thought I would share my trials with the world.
My first issue was, How do I get the new node id that was created by drupal_execute(). Well It [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to migrate data into Drupal. To do this I decided to just run drupal_execute(), to create the nodes. I ran into a few quirks and thought I would share my trials with the world.</p>
<p>My first issue was, How do I get the new node id that was created by drupal_execute(). Well It was easier than I thought. I did a little goggling and found people saying that you should use db_last_id(), well that did not work for me. Instead I used the &#8220;$form_state&#8221; variable that I passed into the drupal_execute function. I noticed that after running drupal_execute() I could use <strong>$form_state['nid']</strong> to retrieve the nodes id. Wow wasn&#8217;t that easy.</p>
<p>The nodes I was creating were using cck fields. I noticed that only the first node&#8217;s cck fields were created correctly. All subsequent nodes were created with cck fields containing just 1 character(I believe this only happened on select fields). To fix this issue I had to use the node id that I retireved and set the cck fields again. Then do a node_save(). Now all my fields are correct and I can go Fishing.:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/06/04/drupal-adding-nodes-programaticly-using-drupal_execute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal: Wysiwyg TinyMce not working in IE</title>
		<link>http://www.sharpdotinc.com/mdost/2010/04/21/drupal-wysiwyg-tinymce-not-working-in-ie/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/04/21/drupal-wysiwyg-tinymce-not-working-in-ie/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:38:56 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/drupal/"><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=219</guid>
		<description><![CDATA[I recently was developing a Drupal Ver6 site and when doing functionality testing noticed that the TinyMce Editor was not working in IE. The editor buttons would not display. After hours of bug hunting and goggling I finally figured out the problem. IE apparently limits how many css includes you can have, so to resolve [...]]]></description>
			<content:encoded><![CDATA[<p>I recently was developing a Drupal Ver6 site and when doing functionality testing noticed that the TinyMce Editor was not working in IE. The editor buttons would not display. After hours of bug hunting and goggling I finally figured out the problem. IE apparently limits how many css includes you can have, so to resolve the issue I just had to Enable &#8220;<strong>Optimize Css Files</strong>&#8221; from the performance tab.</p>
<p>Hope this saves you hours of searching.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/04/21/drupal-wysiwyg-tinymce-not-working-in-ie/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Drupal: Forms, and Form Templates, Contact Form Template</title>
		<link>http://www.sharpdotinc.com/mdost/2010/04/14/drupal-forms-and-form-templates-contact-form-template/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/04/14/drupal-forms-and-form-templates-contact-form-template/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 15:59:41 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/drupal/"><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=215</guid>
		<description><![CDATA[I found this great video about adding a template to the drupal contact form and wanted to make sure I did not forget where I found it. It also has good general information about working with forms.

]]></description>
			<content:encoded><![CDATA[<p>I found this great video about adding a template to the drupal contact form and wanted to make sure I did not forget where I found it. It also has good general information about working with forms.</p>
<p><embed src="http://blip.tv/play/AcX0YwI" type="application/x-shockwave-flash" width="480" height="300" allowscriptaccess="always" allowfullscreen="true"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/04/14/drupal-forms-and-form-templates-contact-form-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse: Setting up FTP in Eclipse Galileo</title>
		<link>http://www.sharpdotinc.com/mdost/2010/04/07/eclipse-setting-up-ftp-in-eclipse-galileo/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/04/07/eclipse-setting-up-ftp-in-eclipse-galileo/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 03:58:04 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/productivity-applications/eclipse/"><![CDATA[Eclipse]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/category/productivity-applications/"><![CDATA[Productivity Applications]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=211</guid>
		<description><![CDATA[The method I used to get FTP in Eclipse was to install Aptana Studio and Use the FTP client that came with it.

 Once you get Aptana Installed you will need to open the Aptana Web perspective (Window -&#62; Open Perspective-&#62; Other -&#62; Aptana Web).
Once you have the perspective open you should see a tab [...]]]></description>
			<content:encoded><![CDATA[<p>The method I used to get FTP in Eclipse was to install <a title="Aptana Studio Download" href="http://www.aptana.org/studio/download" target="_blank">Aptana Studio</a> and Use the FTP client that came with it.</p>
<ul>
<li> Once you get Aptana Installed you will need to open the <strong>Aptana Web</strong> perspective (<strong>Window -&gt; Open Perspective-&gt; Other -&gt; Aptana Web</strong>).</li>
<li>Once you have the perspective open you should see a tab called <strong>File</strong>, if you don&#8217;t see this tab you can open it by going to <strong>Window -&gt; Show View -&gt; File.</strong></li>
<li><strong> </strong>In the File tab there should be an item called FTP, if you right click on it you will be presented with ftp options to create a Ftp Site.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/04/07/eclipse-setting-up-ftp-in-eclipse-galileo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal: Complex View Layout, Getting Down and Dirty!</title>
		<link>http://www.sharpdotinc.com/mdost/2010/04/06/drupal-complex-view-layout-getting-down-and-dirty/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/04/06/drupal-complex-view-layout-getting-down-and-dirty/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 15:47:21 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/tag/drupal/"><![CDATA[Drupal]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/category/php/"><![CDATA[PHP]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/tag/display-data/"><![CDATA[display data]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/tag/views/"><![CDATA[views]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=206</guid>
		<description><![CDATA[Drupal provides a ton of great functionality, but every now and then you get a designer, Amber   , who just try&#8217;s to come up with a design for a Drupal site that challenges your knowledge of the system. Well thanks to the challenge I have found a nice bit of functionality to allow [...]]]></description>
			<content:encoded><![CDATA[<p>Drupal provides a ton of great functionality, but every now and then you get a designer, Amber <img src='http://www.sharpdotinc.com/mdost/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , who just try&#8217;s to come up with a design for a Drupal site that challenges your knowledge of the system. Well thanks to the challenge I have found a nice bit of functionality to allow very custom views.</p>
<p>My challage was to have a block created by a View, pull the top 3 news nodes (basically like a blog) and display it on the homepage side-bar. Well that is not difficult, I even created a template for the block. Well now we wanted to show additional data for the first item in the view and not for the rest.</p>
<p><strong>Question:</strong> Well, there is not a loop or counter to check for in the template file so how was I to get this done?<br />
<strong>Answer:</strong> Using a Views Attachment Display.</p>
<p>Drupal Views have a display type called <em><strong>attachment</strong></em>. It is exactly as its name sounds,  a view that attaches to another. You can set it to display the additional data that you would like to display for the first item(or how ever many you want) then tell the Attachment Display to display before/after another View. Just change the offset of the main view to compensate for the items brought in by the Attachment.</p>
<p>Hope this helps others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/04/06/drupal-complex-view-layout-getting-down-and-dirty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Import Multiple Images or Remove Images durring Batch Import</title>
		<link>http://www.sharpdotinc.com/mdost/2010/03/02/magento-import-multiple-images-or-remove-images-durring-batch-import/</link>
		<comments>http://www.sharpdotinc.com/mdost/2010/03/02/magento-import-multiple-images-or-remove-images-durring-batch-import/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 22:01:22 +0000</pubDate>
		<dc:creator>Mike D</dc:creator>
						<category domain="http://www.sharpdotinc.com/mdost/category/php/"><![CDATA[PHP]]></category>
		<category domain="http://www.sharpdotinc.com/mdost/category/magento/"><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.sharpdotinc.com/mdost/?p=179</guid>
		<description><![CDATA[This article will detail how to adjust the Magento Batch Import (Dataflow) to allow uploading multiple gallery images, and also how to add a way to remove all images during Import/Update.
These are the accompaning files: (Please reference this file if you have any quetion about the code examples below. The WYSIWYG editor was messing things [...]]]></description>
			<content:encoded><![CDATA[<p>This article will detail how to adjust the Magento Batch Import (Dataflow) to allow uploading multiple gallery images, and also how to add a way to remove all images during Import/Update.</p>
<p>These are the accompaning files: <strong>(Please reference this file if you have any quetion about the code examples below. The WYSIWYG editor was messing things up. mainly &#8220;&amp;&#8217;s&#8221; and &#8220;empty()&#8217;s&#8221; )</strong><br />
1. <a href='http://www.sharpdotinc.com/mdost/files/2010/03/modifiedsaverow_magento.txt' target="_blank">Full Code Example</a></p>
<p>First we are going to have to modify the the adapter used to save/update products during the import process. The file used is located here: &#8220;<strong>/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php</strong>&#8220;. Since we are going to be modifying this file we should extend it so we don&#8217;t change any core files. There are plenty of articles that detail how to extend/customize Magento files so I will not go into it.</p>
<p>First lets tackle adding multiple gallery images. These are images that appear on the products detail page below the main image. We will be making all our edits in the Product.php file mentioned in the previous paragraph. Find the <em><strong>SaveRow</strong></em> method. In this method find the code where Magento saves the products images(should be similar to the following code and around line 630).</p>
<pre class="brush: php">
        $imageData = array();
        foreach ($this-&gt;_imageFields as $field) {
            if (!empty($importData[$field]) &amp;&amp; $importData[$field] != &#039;no_selection&#039;) {
                if (!isset($imageData[$importData[$field]])) {
                    $imageData[$importData[$field]] = array();
                }
                $imageData[$importData[$field]][] = $field;
            }
        }

        foreach ($imageData as $file =&gt; $fields) {
            try {
                $product-&gt;addImageToMediaGallery(Mage::getBaseDir(&#039;media&#039;) . DS . &#039;import&#039; . $file, $fields);
            }
            catch (Exception $e) {}
        }
</pre>
<p>First thing we will do is change the <strong>addImageToMediaGallery</strong> so that when it saves the image it is not excluded(saves you from having to re-edit the products after import to make the images appear.).</p>
<pre class="brush: php">

        foreach ($imageData as $file =&gt; $fields) {
            try {
            	// changed to not mark imported images as &#039;excluded&#039; - see http://www.magentocommerce.com/boards/viewthread/6971/P15/ and http://www.magentocommerce.com/boards/viewthread/40007/
                //$product-&gt;addImageToMediaGallery(Mage::getBaseDir(&#039;media&#039;) . DS . &#039;import&#039; . $file, $fields);
                $product-&gt;addImageToMediaGallery(Mage::getBaseDir(&#039;media&#039;) . DS . &#039;import&#039; . $file, $fields, false, false);
            }
            catch (Exception $e) {}
        }
</pre>
<p>Now we can add the code to import multiple gallery images. Just below the code above add this new code:</p>
<pre class="brush: php">
            //Now add each gallery image.
        if (!empty($importData[&#039;gallimg&#039;])) {
			//$importData[&#039;gallimg&#039;] should be a list of images to import seperated by &quot;;&quot;
			$images = explode(&quot;;&quot;, $importData[&#039;gallimg&#039;]);
			foreach($images as $image){
				//Don&#039;t add field for gallimg&#039;s
				try {
					//made second param null so it is not added as the main image, small or thumb. just added to the gallery
					$product-&gt;addImageToMediaGallery(Mage::getBaseDir(&#039;media&#039;) . DS . &#039;import&#039; . trim($image), NULL, false, false);
				}
				catch (Exception $e) {}

			}
        }
</pre>
<p>In order to use this new code you need to add a new column to your import spreadsheet. Label the column &#8220;gallimg&#8221;. This needs to be a list of the images you want to import separated by a &#8220;;&#8221;.<br />
Now that was not too hard was it?</p>
<p>Now we can address removing images during the import/update process. In order to remove all the images you will need to continue modifying the saveRow method. Add the following code just above the code we previously edited.</p>
<pre class="brush: php">
        //MRD added to remove all images for product before uploading new images
        if(isset($importData[&#039;remove_all_images&#039;]) &amp;&amp; $importData[&#039;remove_all_images&#039;]==&quot;yes&quot; ){
	        //check if gallery attribute exists then remove all images if it exists
	        //Get products gallery attribute
	        $attributes = $product-&gt;getTypeInstance()-&gt;getSetAttributes();
        	if (isset($attributes[&#039;media_gallery&#039;])) {
				$gallery = $attributes[&#039;media_gallery&#039;];
				//Get the images
				$galleryData = $product-&gt;getMediaGallery();
				foreach($galleryData[&#039;images&#039;] as $image){
				//If image exists
			    	if ($gallery-&gt;getBackend()-&gt;getImage($product, $image[&#039;file&#039;])) {
			            $gallery-&gt;getBackend()-&gt;removeImage($product, $image[&#039;file&#039;]);
			        }
				}
			}
			#$gallery-&gt;clearMediaAttribute($product, array(&#039;image&#039;,&#039;small_image&#039;,&#039;thumbnail&#039;));
        }
        //END Remove Images
</pre>
<p>To utilize the code we just created you will need to add the &#8220;remove_all_images&#8221; column to your spreadsheet and set the value to &#8220;yes&#8221;.</p>
<p>This was written using Magento version 1.2.1 so your files could be slightly different, but should still work if you follow the instruction. If you have any problems please leave a productive comment and I will see how I can help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdotinc.com/mdost/2010/03/02/magento-import-multiple-images-or-remove-images-durring-batch-import/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
