<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Pratthost Developer Zone</title>
	
	<link>http://devzone.pratthost.com</link>
	<description>A resource for web developers</description>
	<lastBuildDate>Fri, 16 Oct 2009 00:39:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/pratthostdevzone" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Magento: Doesn’t Work Well For Warehouse Processing</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/GhLpvTGFDUM/</link>
		<comments>http://devzone.pratthost.com/2009/10/15/magento-doesnt-work-well-for-warehouse-processing/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 00:39:52 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=349</guid>
		<description><![CDATA[
I had a long phone conversation with a gentleman that handles the warehouse processing for one of our Magento clients.  They are quite disappointed with the way Magento handles the order fulfillment process.  Perhaps there is a better method than what this guy is suggesting, but perhaps Magento needs to be able to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/09/magento_icon.jpg" alt="Magento Icon" title="Magento Icon" width="67" height="67" class="alignleft size-full wp-image-60" /></p>
<p>I had a long phone conversation with a gentleman that handles the warehouse processing for one of our Magento clients.  They are quite disappointed with the way Magento handles the order fulfillment process.  Perhaps there is a better method than what this guy is suggesting, but perhaps Magento needs to be able to flexible in terms of how orders are processed.</p>
<p>Here is the problem:  The warehouse tells me that they need to print of the packing slips so that they can go and put the order together.  Apparently that&#8217;s how they&#8217;ve always done things.  Magento considers the packing slip printing to be the last step in the process, and therefore marks the order complete.  However, that is not the end of the process for this warehouse.  There are plenty of times that they need to go in and edit or cancel an order after the packing slip has been printed out, but once an order is completed in Magento, that is no longer possible.</p>
<p>I&#8217;d like to think that they aren&#8217;t the only warehouse out there that does things this way, and according to the guy I talked with, that&#8217;s the way most people do it.  If that is the case, I&#8217;m going to have to try and write a module that allows you to print off a packing slip at any time for an order, without changing the status of the order.  If this guy is right though, I think Magento needs to add in some flexibility for different types of order processing.</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/GhLpvTGFDUM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2009/10/15/magento-doesnt-work-well-for-warehouse-processing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2009/10/15/magento-doesnt-work-well-for-warehouse-processing/</feedburner:origLink></item>
		<item>
		<title>Magento: Import Multiple Images for Products Module</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/QNXrwOJqWNI/</link>
		<comments>http://devzone.pratthost.com/2009/10/09/magento-import-multiple-images-for-products-module/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 13:01:23 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=344</guid>
		<description><![CDATA[
I still am confused as to why Magento hasn&#8217;t built-in the ability to upload multiple images for each product.  After scoping it out, finally, I discovered that the modification was quite simple.  I haven&#8217;t put the module up on Magento Connect yet (not sure if I will), but here I will lay out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/09/magento_icon.jpg" alt="Magento Icon" title="Magento Icon" width="67" height="67" class="alignleft size-full wp-image-60" /></p>
<p>I still am confused as to why Magento hasn&#8217;t built-in the ability to upload multiple images for each product.  After scoping it out, finally, I discovered that the modification was quite simple.  I haven&#8217;t put the module up on Magento Connect yet (not sure if I will), but here I will lay out how to do it, which for some of you may help you understand how modules work, if you don&#8217;t know already.</p>
<p>I&#8217;ve seen some solutions out there that modify core code, some that just take a file and move it to your /app/code/local/ retaining the same directory structure, so as to just override the file.  I don&#8217;t recommend either of these methods (especially the first), as with a true module you are setting up a much better environment over time for this to last.  And a module allows you to ONLY override the methods you need to modify, instead of entire classes.  Plus, you can easily disable the module right in the admin (Admin >> System >> Configuration >> Advanced).</p>
<p>Be sure you replace all of the &#8220;YOURSTUFF&#8221; with your name or company name.</p>
<p><em>I have only tested this with 1.3.2.4</em></p>
<h4>Step 1:</h4>
<p>Create the file:  /app/etc/modules/YOURSTUFF_ImportMultipleImages.xml.  This file tells Magento that you have this module and where it is located.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;YOURSTUFF_ImportMultipleImages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>local<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/YOURSTUFF_ImportMultipleImages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h4>Step 2:</h4>
<p>Create the file:  /app/code/local/YOURSTUFF/ImportMultipleImages/etc/config.xml.  This file is the configuration file for your module.  It tells Magento which class we are going to override.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;YOURSTUFF_ImportMultipleImages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/YOURSTUFF_ImportMultipleImages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;models<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;catalog<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #808080; font-style: italic;">&lt;!-- Override Mage_Catalog_Model_Convert_Adapter_Product --&gt;</span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;convert_adapter_product<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>YOURSTUFF_ImportMultipleImages_Model_Convert_Adapter_Product<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/convert_adapter_product<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/catalog<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/models<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h4>Step 3:</h3>
<p>Create the file:  /app/code/local/YOURSTUFF/ImportMultipleImages/Model/Convert/Adapter/Product.php.  Important note:  When creating a module, you only want to include the methods that you are actually modifying.  As you can see, we are extending the original class, so we&#8217;ll have all of the methods from the original, but since we have the saveRow() method in our class, ours will take precedence.  We do it this way because when you upgrade Magento, you&#8217;ll only need to make sure you check the one method for changes, instead of the entire class.</p>
<p><strong>Again, be sure to replace the &#8220;YOURSTUFF&#8221; in the class name to your name or company name.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * Import Multiple Images during Product Import
 *
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> YOURSTUFF_ImportMultipleImages_Model_Convert_Adapter_Product <span style="color: #000000; font-weight: bold;">extends</span> Mage_Catalog_Model_Convert_Adapter_Product
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * Save product (import)
     *
     * @param array $importData
     * @throws Mage_Core_Exception
     * @return bool
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> saveRow<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span> <span style="color: #000088;">$importData</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$product</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBatchParams</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$store</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreById</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBatchParams</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, required field &quot;%s&quot; not defined'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$store</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreByCode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, store &quot;%s&quot; field not exists'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'store'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sku'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, required field &quot;%s&quot; not defined'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sku'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setStoreId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$productId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdBySku</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sku'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$productId</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$productTypes</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductTypes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$productAttributeSets</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductAttributeSets</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009933; font-style: italic;">/**
             * Check product define type
             */</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productTypes</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, is not valid value &quot;%s&quot; for field &quot;%s&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTypeId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productTypes</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009933; font-style: italic;">/**
             * Check product define attribute set
             */</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productAttributeSets</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, is not valid value &quot;%s&quot; for field &quot;%s&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttributeSetId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productAttributeSets</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'attribute_set'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_requiredFields <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$attribute</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$attribute</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIsRequired</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Skip import row, required field &quot;%s&quot; for new products not defined'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    Mage<span style="color: #339933;">::</span><span style="color: #004000;">throwException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setProductTypeInstance</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$product</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category_ids'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setCategoryIds</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category_ids'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ignoreFields <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$websiteIds</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getWebsiteIds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$websiteIds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getWebsiteId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$store</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getWebsiteId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setWebsiteIds</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websites'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$websiteIds</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getWebsiteIds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$websiteIds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$websiteCodes</span> <span style="color: #339933;">=</span> <span style="color: #990000;">split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websites'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteCodes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$websiteCode</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                try <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$website</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getWebsite</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteCode</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$website</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$website</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setWebsiteIds</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$websiteIds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_inventoryFields<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_imageFields<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000088;">$attribute</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$attribute</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000088;">$isArray</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$setValue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrontendInput</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'multiselect'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #990000;">split</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">MULTI_DELIMITER</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$isArray</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$setValue</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBackendType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'decimal'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$setValue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNumber</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">usesSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAllOptions</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$isArray</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$setValue</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$setValue</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$setValue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setData</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$setValue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVisibility</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setVisibility</span><span style="color: #009900;">&#40;</span>Mage_Catalog_Model_Product_Visibility<span style="color: #339933;">::</span><span style="color: #004000;">VISIBILITY_NOT_VISIBLE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$stockData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$inventoryFields</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_inventoryFieldsProductTypes<span style="color: #009900;">&#91;</span><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTypeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
            ? <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_inventoryFieldsProductTypes<span style="color: #009900;">&#91;</span><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTypeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span>
            <span style="color: #339933;">:</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$inventoryFields</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_toNumber<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$stockData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNumber</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$stockData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setStockData</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stockData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$imageData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_imageFields <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'no_selection'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imageData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$imageData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000088;">$imageData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$field</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$imageData</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            try <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addImageToMediaGallery</span><span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getBaseDir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'media'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> DS <span style="color: #339933;">.</span> <span style="color: #0000ff;">'import'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009933; font-style: italic;">/**
		 * Allows you to import multiple images for each product.
		 * Simply add a 'gallery' column to the import file, and separate
		 * each image with a semi-colon.
		 */</span>
	        try <span style="color: #009900;">&#123;</span>
	                <span style="color: #000088;">$galleryData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">,</span><span style="color: #000088;">$importData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;gallery&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	                <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$galleryData</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$gallery_img</span><span style="color: #009900;">&#41;</span>
					<span style="color: #009933; font-style: italic;">/**
					 * @param directory where import image resides
					 * @param leave 'null' so that it isn't imported as thumbnail, base, or small
					 * @param false = the image is copied, not moved from the import directory to it's new location
					 * @param false = not excluded from the front end gallery
					 */</span>
	                <span style="color: #009900;">&#123;</span>
	                        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addImageToMediaGallery</span><span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getBaseDir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'media'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> DS <span style="color: #339933;">.</span> <span style="color: #0000ff;">'import'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$gallery_img</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	                <span style="color: #009900;">&#125;</span>
	            <span style="color: #009900;">&#125;</span>
	        catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>        
		<span style="color: #666666; font-style: italic;">/* End Modification */</span>
&nbsp;
        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setIsMassupdate</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setExcludeUrlRewrite</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Step 4:</h4>
<p>Test it out!  This is how it works:  Use the Magento product import functionality (Admin >> System >> Import/Export >> Profiles >> Import All Products).  Add a column to your CSV called &#8216;gallery&#8217;.  In that column, simply put all the images you&#8217;d like that product to have, separated by semi-colons.  The same exact rules apply for these images as do the &#8216;image&#8217;, &#8217;small_image&#8217;, and &#8216;thumbnail&#8217; columns, in that if you are putting all your images in the /media/import/ directory, you&#8217;ll have to include the forward-slash in the image names.  Here&#8217;s an example (be sure to leave out any spaces):</p>
<p>Your gallery column could look like:  /image1.jpg;/image2.jpg;/image3.jpg</p>
<p>These images will all show up just as if you were to go into the product edit in the admin and upload them.  They&#8217;ll be copied from the /media/import/ directory into the proper media directory structure, and they&#8217;ll show up as thumbnails below your main product image on the product view page.</p>
<p>Comment if you have any questions.  Enjoy!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/QNXrwOJqWNI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2009/10/09/magento-import-multiple-images-for-products-module/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2009/10/09/magento-import-multiple-images-for-products-module/</feedburner:origLink></item>
		<item>
		<title>Back Again!</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/P-MypGa14ys/</link>
		<comments>http://devzone.pratthost.com/2009/10/09/back-again/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:36:02 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=342</guid>
		<description><![CDATA[It&#8217;s been quite a long time since I last updated my blog.  But, I think I&#8217;m ready for another season of blogging for a while.  And to kick it off &#8211; I am going to post the Magento Multiple Image Import Module that I created the other day.  Expect it soon!
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been quite a long time since I last updated my blog.  But, I think I&#8217;m ready for another season of blogging for a while.  And to kick it off &#8211; I am going to post the Magento Multiple Image Import Module that I created the other day.  Expect it soon!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/P-MypGa14ys" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2009/10/09/back-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2009/10/09/back-again/</feedburner:origLink></item>
		<item>
		<title>Basecamp: Todo Templates Script</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/m9SHrXajYbQ/</link>
		<comments>http://devzone.pratthost.com/2009/02/08/basecamp-todo-templates-script/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 21:26:58 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=337</guid>
		<description><![CDATA[
 If you want an easy way to add and manage todo lists templates for your projects (if they tend to have the same type of checklists &#8211; such as website pre-launch checklists), then this script is for you.  It&#8217;s a simple method of maintaining todo list templates, and adding them to any of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/10/icon_basecamp.jpg" alt="" title="Basecamp Icon" width="68" height="68" class="alignleft size-medium wp-image-181" /></p>
<p> If you want an easy way to add and manage todo lists templates for your projects (if they tend to have the same type of checklists &#8211; such as website pre-launch checklists), then this script is for you.  It&#8217;s a simple method of maintaining todo list templates, and adding them to any of the projects in your Basecamp account, with ease.</p>
<p>What you do is simply create a new project specifically for keeping your todo lists under your company in Basecamp.  You then supply the script with that project id, and your Basecamp login information, and you are set to go.  Simply add some todo lists and items, then navigate to the script on your server, and it is dynamically populated for you.</p>
<p>You can check out the details by clicking the link above in the page navigation or click the following to read more details and download the <a href="http://devzone.pratthost.com/basecamp-todo-templates/">Basecamp Todo List Template</a> script.</p>
<p>If you have any questions, or if you have any feature requests, please post a comment.  I hope you will find it a useful tool!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/m9SHrXajYbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2009/02/08/basecamp-todo-templates-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2009/02/08/basecamp-todo-templates-script/</feedburner:origLink></item>
		<item>
		<title>Magento: Display Only If There Are Products In The Category</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/ho4sSuExlCI/</link>
		<comments>http://devzone.pratthost.com/2008/12/17/magento-display-only-if-there-are-products-in-the-category/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:52:03 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=327</guid>
		<description><![CDATA[
This is a more difficult post to title &#8211; but I think that should do it.  Here was my need today:  We&#8217;ve got some navigational links in the header, and there are two categories &#8220;Sale Items&#8221; and &#8220;Internet Only&#8221; that should show up as links ONLY if there are products in those categories [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/09/magento_icon.jpg" alt="Magento Icon" title="Magento Icon" width="67" height="67" class="alignleft size-full wp-image-60" /></p>
<p>This is a more difficult post to title &#8211; but I think that should do it.  Here was my need today:  We&#8217;ve got some navigational links in the header, and there are two categories &#8220;Sale Items&#8221; and &#8220;Internet Only&#8221; that should show up as links ONLY if there are products in those categories &#8211; otherwise, they shouldn&#8217;t be there (no need to have a link to a category with no products in it).</p>
<h4>The Solution</h4>
<p>There&#8217;s a quick&#8217;n'easy code line that you can pass in a category id to, and it will return how many products are in that category:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">198</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>So &#8211; I got the category IDs from the admin and I created the following code to check the count &#8211; and display the link only if there are products in that category:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000088;">$sale_count</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">198</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sale_count</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li class=&quot;sale&quot;&gt;&lt;a href=&quot;/sale/&quot;&gt;Sale Items&lt;/a&gt;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$internet_count</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProductCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$internet_count</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li class=&quot;internet&quot;&gt;&lt;a href=&quot;/internet-only/&quot;&gt;Internet Only&lt;/a&gt;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Hopefully you can find that useful if you need it!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/ho4sSuExlCI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/17/magento-display-only-if-there-are-products-in-the-category/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/17/magento-display-only-if-there-are-products-in-the-category/</feedburner:origLink></item>
		<item>
		<title>WordPress: Just Upgraded to 2.7 – Wow!</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/lzPiA0ysOOQ/</link>
		<comments>http://devzone.pratthost.com/2008/12/12/wordpress-just-upgraded-to-27/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 20:44:34 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=321</guid>
		<description><![CDATA[
When I saw that WordPress 2.7 released yesterday (Dec. 11th), I didn&#8217;t really think much of it.  After all &#8211; I don&#8217;t have any complaints about what WordPress is doing for me now.  However, I decided to take the couple minutes to check out the video that they posted about it and I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/10/icon_wordpress.jpg" alt="Wordpress Icon" title="Wordpress Icon" width="70" height="70" class="alignleft size-full wp-image-97" /></p>
<p>When I saw that <a href="http://wordpress.org/development/2008/12/coltrane/">WordPress 2.7 released</a> yesterday (Dec. 11th), I didn&#8217;t really think much of it.  After all &#8211; I don&#8217;t have any complaints about what WordPress is doing for me now.  However, I decided to take the couple minutes to check out the video that they posted about it and I quickly realized how stupid I would be if I didn&#8217;t upgrade!</p>
<p>I&#8217;m still exploring all the new features and I&#8217;m still in awe at the new user interface, but it is truly amazing.  Check out the video for yourself!  No need for me to list all the new features &#8211; the video does a fine job:</p>
<p><center><embed src="http://v.wordpress.com/hFr8Nyar" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></center></p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/lzPiA0ysOOQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/12/wordpress-just-upgraded-to-27/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/12/wordpress-just-upgraded-to-27/</feedburner:origLink></item>
		<item>
		<title>Magento: When Launching – Turn Cache Back On!</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/ywCQBfYztjc/</link>
		<comments>http://devzone.pratthost.com/2008/12/10/magento-when-launching-turn-cacheing-back-on/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 17:37:09 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=319</guid>
		<description><![CDATA[
We actually forgot to do this with one of our sites &#8211; but when developing, we obviously had cache fully disabled.  When you go to launch, there are so many other things you are thinking about that it is easy to forget to enable all the cache again.
So, as a reminder to all of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/09/magento_icon.jpg" alt="" title="Magento Icon" width="67" height="67" class="alignleft size-medium wp-image-60" /></p>
<p>We actually forgot to do this with one of our sites &#8211; but when developing, we obviously had cache fully disabled.  When you go to launch, there are so many other things you are thinking about that it is easy to forget to enable all the cache again.</p>
<p>So, as a reminder to all of you that have launched Magento sites, turn back on the cache if you haven&#8217;t yet!  It will definitely speed up the performance of the site.</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/ywCQBfYztjc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/10/magento-when-launching-turn-cacheing-back-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/10/magento-when-launching-turn-cacheing-back-on/</feedburner:origLink></item>
		<item>
		<title>Basecamp: New Info From 37 Signals</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/1thWGDC_Hks/</link>
		<comments>http://devzone.pratthost.com/2008/12/08/basecamp-new-info-from-37-signals/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 21:28:09 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Basecamp]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=311</guid>
		<description><![CDATA[
I was able to get in contact with a developer from 37 Signals over the weekend.  I ran into some troubles finding a solid way to process the responses when you post, get, or put data to/from the Basecamp API.  Turns out, the documentation is out-dated, and there are some known inconsistencies.
So &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/10/icon_basecamp.jpg" alt="" title="Basecamp Icon" width="68" height="68" class="alignleft size-medium wp-image-181" /></p>
<p>I was able to get in contact with a developer from <a href="http://www.37signals.com/">37 Signals</a> over the weekend.  I ran into some troubles finding a solid way to process the responses when you post, get, or put data to/from the Basecamp API.  Turns out, the documentation is out-dated, and there are some known inconsistencies.</p>
<p>So &#8211; now knowing some crucial information &#8220;from the horse&#8217;s mouth&#8221;, I know now how to properly process the responses.  This will be implemented in version 1.2.  I&#8217;ll keep you posted!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/1thWGDC_Hks" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/08/basecamp-new-info-from-37-signals/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/08/basecamp-new-info-from-37-signals/</feedburner:origLink></item>
		<item>
		<title>Basecamp API: PHP Class – Version 1.1 Released</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/bJT8z2Cf-eE/</link>
		<comments>http://devzone.pratthost.com/2008/12/04/basecamp-api-php-class-version-11-released/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 04:45:00 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Basecamp]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=299</guid>
		<description><![CDATA[
Version 1.1 is now released. Please check out the Basecamp PHP Class page for new documentation and download information.
There were a lot of changes, new methods (including file attachments), and bug fixes in 1.1.  There&#8217;s still a lot of work to do, but I like to get it out into the user&#8217;s hands for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/10/icon_basecamp.jpg" alt="" title="Basecamp Icon" width="68" height="68" class="alignleft size-medium wp-image-181" /></p>
<p>Version 1.1 is now released. Please check out the <a href="http://devzone.pratthost.com/basecamp-php-class/">Basecamp PHP Class page</a> for new documentation and download information.</p>
<p>There were a lot of changes, new methods (including file attachments), and bug fixes in 1.1.  There&#8217;s still a lot of work to do, but I like to get it out into the user&#8217;s hands for feedback and bug-tracking.  If you are noticing something that isn&#8217;t working, or is glitchy, first check the method documentation within the class itself to make sure you are using it correction, then if it still isn&#8217;t working right &#8211; please let me know! (Post a comment here).</p>
<p>I may have easily incorrectly documented something, or forgot to make changes.  I ran out of time this evening and had to rush through it.  So, please keep that in mind!</p>
<p>I am very open to making quick changes/fixes and releases.  One of the best ways to contact me is through AIM (&#8221;creativearcjosh&#8221;).  Feel free to hop on and ask questions or make suggestions if I&#8217;m online.</p>
<p>I want to make this PHP class good, and solid.  So &#8211; I love the feedback and suggestions.  Keep them coming!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/bJT8z2Cf-eE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/04/basecamp-api-php-class-version-11-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/04/basecamp-api-php-class-version-11-released/</feedburner:origLink></item>
		<item>
		<title>YouTube: Creating and Using Playlists</title>
		<link>http://feedproxy.google.com/~r/pratthostdevzone/~3/OdRNupZPzHI/</link>
		<comments>http://devzone.pratthost.com/2008/12/04/you-tube-creating-and-using-playlists/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 15:03:58 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Free Services]]></category>

		<guid isPermaLink="false">http://devzone.pratthost.com/?p=283</guid>
		<description><![CDATA[
I discovered something great the other day, and I figured I would pass it along for any of you that don&#8217;t know about it.  YouTube is loaded with music.  You can usually find the song you are looking for.  So, instead of buying music to listen to at home or work, you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://devzone.pratthost.com/wp-content/uploads/2008/12/you_tube_logo.jpg" alt="" title="You Tube Logo" width="67" height="47" class="alignleft size-medium wp-image-284" /></p>
<p>I discovered something great the other day, and I figured I would pass it along for any of you that don&#8217;t know about it.  <a href="http://www.youtube.com">YouTube</a> is loaded with music.  You can usually find the song you are looking for.  So, instead of buying music to listen to at home or work, you can create playlists in YouTube if you have created an account.</p>
<p>When you have created a playlist, you can then to go your playlists, select one, and click &#8220;Play All&#8221;, and it will cycle through the entire playlist without you having to touch anything.  So, open up a new tab in your browser, create a playlist, add a bunch of songs to it, click &#8220;Play All&#8221;, and you&#8217;ll have some nice listening without touching a thing!</p>
<img src="http://feeds.feedburner.com/~r/pratthostdevzone/~4/OdRNupZPzHI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://devzone.pratthost.com/2008/12/04/you-tube-creating-and-using-playlists/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://devzone.pratthost.com/2008/12/04/you-tube-creating-and-using-playlists/</feedburner:origLink></item>
	</channel>
</rss>
