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

<channel>
	<title>Prattski &#124; Magento &#38; Web Development &#187; Magento</title>
	<atom:link href="http://prattski.com/category/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://prattski.com</link>
	<description></description>
	<lastBuildDate>Fri, 11 May 2012 14:05:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Magento: Programmatically Modify Attribute Configuration</title>
		<link>http://prattski.com/2012/04/30/magento-programmatically-modify-attribute-configuration/</link>
		<comments>http://prattski.com/2012/04/30/magento-programmatically-modify-attribute-configuration/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 20:15:15 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=844</guid>
		<description><![CDATA[Today I was asked programmatically modify a product attribute so that it was no longer searchable, and make a different attribute searchable instead. I wrote up the code and put it on our database updater module to run as an &#8230; <a href="http://prattski.com/2012/04/30/magento-programmatically-modify-attribute-configuration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I was asked programmatically modify a product attribute so that it was no longer searchable, and make a different attribute searchable instead.  I wrote up the code and put it on our database updater module to run as an upgrade script, but you could put it anywhere you want.  To modify an attribute, you can do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Method 1</span>
<span style="color: #000088;">$model</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/resource_eav_attribute'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadByCode</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'color'</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;">$model</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setIsFilterable</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setIsFilterableInSearch</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</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>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Method 2</span>
<span style="color: #000088;">$attributeId</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getResourceModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'eav/entity_attribute'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdByCode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog_product'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'color'</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;">$attributeId</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$attribute</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/resource_eav_attribute'</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: #000088;">$attributeId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setIsSearchable</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</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>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can see I used the setIsSearchable() magic method to set the the &#8216;is_searchable&#8217; for the color attribute to 0, which is &#8220;No&#8221;.  You can change whatever you want and then save it and you are good to go.</p>
<p>If you want to know what options you can change, load up the attribute, and log/output $attribute->getData().  It will show you all the current settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2012/04/30/magento-programmatically-modify-attribute-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento: More Flexibility For Your Layout Updates</title>
		<link>http://prattski.com/2012/04/25/magento-more-flexibility-for-your-layout-updates/</link>
		<comments>http://prattski.com/2012/04/25/magento-more-flexibility-for-your-layout-updates/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 02:58:31 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=841</guid>
		<description><![CDATA[I&#8217;ve been working on a project with a lot of requirements for certain templates or javascript to be added based on a lot of different conditionals and situations that the standard layout xml files do not really allow for. Fortunately, &#8230; <a href="http://prattski.com/2012/04/25/magento-more-flexibility-for-your-layout-updates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a project with a lot of requirements for certain templates or javascript to be added based on a lot of different conditionals and situations that the standard layout xml files do not really allow for.  Fortunately, there are events and methods that you can use to add in xml on the fly without the need for layout xml files, allowing the ability to add in logic as to what and if something should be added or not.</p>
<p>First thing you are going to want to do is create an event observer to observe the &#8216;controller_action_layout_generate_xml_before&#8217; event.  That event will provide you with the layout object.  By accessing the Update object from the layout, we can easily add in our own update:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$layout</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$observer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$layout</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUpdate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addUpdate</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
    &lt;reference name=&quot;content&quot;&gt;
        &lt;block type=&quot;module/block&quot; name=&quot;the.name&quot; template=&quot;your/template.phtml&quot; /&gt;
    &lt;/reference&gt;
'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you wanted that block only to be added if the customer is not logged in, you could wrap the code in a conditional.  You could get quite creative with this in implementing all sorts of cool functionality as we have done on our project.  I hope this provides the tool to get you started!</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2012/04/25/magento-more-flexibility-for-your-layout-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Certified Developer</title>
		<link>http://prattski.com/2012/04/16/magento-certified-developer/</link>
		<comments>http://prattski.com/2012/04/16/magento-certified-developer/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 18:15:14 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=834</guid>
		<description><![CDATA[I am now officially a Magento Certified Developer Plus. I took the exam today and passed. I have been studying hard for the last month, and taking the on-demand Fundamentals of Magento Development course. On top of that, having worked &#8230; <a href="http://prattski.com/2012/04/16/magento-certified-developer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.magentocommerce.com/certification/"><img src="http://prattski.com/wp-content/uploads/2012/04/magento-certified-developer-plus.png" alt="" title="magento-certified-developer-plus" width="66" height="116" class="alignleft size-full wp-image-835" /></a></p>
<p>I am now officially a <a href="http://www.magentocommerce.com/certification/">Magento Certified Developer Plus</a>.  I took the exam today and passed.  I have been studying hard for the last month, and taking the on-demand <a href="http://www.magentocommerce.com/training/on-demand/">Fundamentals of Magento Development</a> course.  On top of that, having worked with Magento for the past 4 years has certainly helped!</p>
<p>Looking forward to even more years in Magento!</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2012/04/16/magento-certified-developer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento: Module Idea &#8211; Scope Level Flags</title>
		<link>http://prattski.com/2012/03/01/magento-module-idea-scope-level-flags/</link>
		<comments>http://prattski.com/2012/03/01/magento-module-idea-scope-level-flags/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 15:22:40 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=832</guid>
		<description><![CDATA[I have run into the situation numerous times (especially when working on Magento sites that were setup by other people) where configuration has been set on the website or store view levels when it didn&#8217;t need to be. You definitely &#8230; <a href="http://prattski.com/2012/03/01/magento-module-idea-scope-level-flags/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have run into the situation numerous times (especially when working on Magento sites that were setup by other people) where configuration has been set on the website or store view levels when it didn&#8217;t need to be.  You definitely cannot assume that people will always understand configuration scope.</p>
<p>The thing that kind of surprises me is that there is no flag/message/etc. that tells you that a setting has been set at a lower level.  If you are looking at the default config, and someone has set some settings on the website level, you&#8217;ll never know unless you change the scope to the website level and find it.  It would be great if there was a flag or a message next to any system config value that lets you know that settings have been set on the website/store view level.  And, with multi-site instances, it should tell you which specific websites have other settings set.</p>
<p>I think I remember trying to create a module to do this a while back, and had a tough time figuring out how to do it well.  I may take a look into it again and see if I have some better luck this time, but if anyone wants to join me in trying to figure it out &#8211; that would be awesome.  It&#8217;s something the Magento community could really benefit from.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2012/03/01/magento-module-idea-scope-level-flags/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Starting a New Job</title>
		<link>http://prattski.com/2012/02/27/starting-a-new-job/</link>
		<comments>http://prattski.com/2012/02/27/starting-a-new-job/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 15:51:14 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=828</guid>
		<description><![CDATA[I am excited to announce that on March 5th, I will be joining the extremely talented team at Lyons Consulting Group as an Applications Engineer. Lyons Consulting Group is the leading Enterprise Magento partner in the U.S. having successfully completed &#8230; <a href="http://prattski.com/2012/02/27/starting-a-new-job/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am excited to announce that on March 5th, I will be joining the extremely talented team at <a href="http://www.lyonscg.com/">Lyons Consulting Group</a> as an Applications Engineer.</p>
<p>Lyons Consulting Group is the leading Enterprise Magento partner in the U.S. having successfully completed hundreds of Magento projects.  In 2010, they won the <a href="http://www.magentocommerce.com/blog/comments/recognizing-magentos-2010-top-solution-partners/">Magento Innovator of the Year</a> award.</p>
<p>They&#8217;ve got great things going on there, and I&#8217;m thrilled to be able to be a part of it as they continue to grow in 2012.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2012/02/27/starting-a-new-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Module:  Hide Empty Categories</title>
		<link>http://prattski.com/2011/10/06/magento-module-hide-empty-categories/</link>
		<comments>http://prattski.com/2011/10/06/magento-module-hide-empty-categories/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 20:58:41 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=809</guid>
		<description><![CDATA[There are a number of ways that you can hide empty categories: You can disable them manually, you can modify the template output to check the product count and if zero don&#8217;t display it, etc. Another way is to write &#8230; <a href="http://prattski.com/2011/10/06/magento-module-hide-empty-categories/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a number of ways that you can hide empty categories:  You can disable them manually, you can modify the template output to check the product count and if zero don&#8217;t display it, etc.  Another way is to write a module and intercept the catalog collection output before it&#8217;s sent to the templates.</p>
<p>I could easily package this up and put it up on Magento Connect, but I&#8217;m more into trying to help people understand Magento modules, so below is a walkthrough of how to create a module that will provide this functionality.</p>
<p><em>Note:</em> Update &#8211; Fixed for Flat Categories too. This has only been tested on 1.6.x.</p>
<h2>Step 1</h2>
<p>Create the file &#8216;/app/etc/modules/Prattski_HideEmptyCategories.xml&#8217;. This file tells Magento that your module exists, if it&#8217;s enabled or not, and where to find it.</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: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">/**</span>
<span style="color: #808080; font-style: italic;"> * Hide Empty Categories</span>
<span style="color: #808080; font-style: italic;"> *</span>
<span style="color: #808080; font-style: italic;"> * @category    Prattski</span>
<span style="color: #808080; font-style: italic;"> * @package     Prattski_HideEmptyCategories</span>
<span style="color: #808080; font-style: italic;"> * @copyright   Copyright (c) 2011 Prattski (http://prattski.com/)</span>
<span style="color: #808080; font-style: italic;"> * @author      Josh Pratt (Prattski)</span>
<span style="color: #808080; font-style: italic;"> */</span>
<span style="color: #808080; font-style: italic;">--&gt;</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;Prattski_HideEmptyCategories<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;/Prattski_HideEmptyCategories<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>

<h2>Step 2</h2>
<p>Now we create our module directory.  Create &#8216;/app/code/local/Prattski/HideEmptyCategories/&#8217;.  This is where our module will reside.  Inside that directory, create this file:  &#8216;etc/config.xml&#8217;.  This file does a number of things:  It tells Magento which version your module is, defines your model namespace and directory, and creates and event observer to observe every time a category collection is loaded.</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: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">/**</span>
<span style="color: #808080; font-style: italic;"> * Hide Empty Categories</span>
<span style="color: #808080; font-style: italic;"> *</span>
<span style="color: #808080; font-style: italic;"> * @category    Prattski</span>
<span style="color: #808080; font-style: italic;"> * @package     Prattski_HideEmptyCategories</span>
<span style="color: #808080; font-style: italic;"> * @copyright   Copyright (c) 2011 Prattski (http://prattski.com/)</span>
<span style="color: #808080; font-style: italic;"> * @author      Josh Pratt (Prattski)</span>
<span style="color: #808080; font-style: italic;"> */</span>
<span style="color: #808080; font-style: italic;">--&gt;</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;Prattski_HideEmptyCategories<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>1.0.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;/Prattski_HideEmptyCategories<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;hideemptycategories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Prattski_HideEmptyCategories_Model<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hideemptycategories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;catalog_resource<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;category_flat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Prattski_HideEmptyCategories_Model_Catalog_Resource_Category_Flat<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/category_flat<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_resource<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;frontend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;catalog_category_collection_load_after<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;observers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hideemptycategories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>singleton<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hideemptycategories/observer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;method<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>catalogCategoryCollectionLoadAfter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/method<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hideemptycategories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/observers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/catalog_category_collection_load_after<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/frontend<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>

<h2>Step 3</h2>
<p>Let&#8217;s create our observer model. As you can see in the file above, we are going to have the &#8216;catalogCategoryCollectionLoadAfter&#8217; method run in this file when it observes the &#8216;catalog_category_collection_load_after&#8217; event. Create this file: Model/Observer.php</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;">/**
 * Hide Empty Categories
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 * @copyright   Copyright (c) 2011 Prattski (http://prattski.com/)
 * @author      Josh Pratt (Prattski)
 */</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Event Observer
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> Prattski_HideEmptyCategories_Model_Observer <span style="color: #000000; font-weight: bold;">extends</span> Mage_Core_Model_Abstract
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * Remove hidden caegories from the collection
     *
     * @param Varien_Event_Observer $observer
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> catalogCategoryCollectionLoadAfter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$observer</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;">$this</span><span style="color: #339933;">-&gt;</span>_isApiRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$collection</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$observer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_removeHiddenCollectionItems<span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Remove hidden items from a product or category collection
     * 
     * @param Mage_Eav_Model_Entity_Collection_Abstract|Mage_Core_Model_Mysql4_Collection_Abstract $collection
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> _removeHiddenCollectionItems<span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Loop through each category or product</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// If it is a category</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEntityTypeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</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;">&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">removeItemByKey</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</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>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Return true if the reqest is made via the api
     *
     * @return boolean
     */</span>
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _isApiRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</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;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getModuleName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'api'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Step 4</h2>
<p>Magento has the ability to turn on Flat Categories to speed up the performance whenever categories are loaded.  The event that we are observing above does not work when Flat Categories are enabled.  So, thanks to <a href="http://netzarbeiter.com/">Vinai&#8217;s</a> help, we need to rewrite a method in a core file to make this work. Create this file: Model/Catalog/Resource/Category/Flat.php</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;">/**
 * Hide Empty Categories
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 * @copyright   Copyright (c) 2011 Prattski (http://prattski.com/)
 * @author      Josh Pratt (Prattski)
 */</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Event Observer
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> Prattski_HideEmptyCategories_Model_Catalog_Resource_Category_Flat
    <span style="color: #000000; font-weight: bold;">extends</span> Mage_Catalog_Model_Resource_Category_Flat
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * Load nodes by parent id
     *
     * @param unknown_type $parentNode
     * @param integer $recursionLevel
     * @param integer $storeId
     * @return Mage_Catalog_Model_Resource_Category_Flat
     */</span>
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _loadNodes<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parentNode</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$recursionLevel</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$storeId</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;">$nodes</span> <span style="color: #339933;">=</span> parent<span style="color: #339933;">::</span>_loadNodes<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parentNode</span><span style="color: #339933;">,</span> <span style="color: #000088;">$recursionLevel</span><span style="color: #339933;">,</span> <span style="color: #000088;">$storeId</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;">$nodes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$node</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;">$node</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: #cc66cc;">0</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;">$nodes</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$node</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;">&#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>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$nodes</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Step 5</h2>
<p>To recap all the files we have made:</p>
<ul>
<li>/app/etc/modules/Prattski_HideEmptyCategories.xml</li>
<li>/app/code/local/Prattski/HideEmptyCategories/etc/config.xml</li>
<li>/app/code/local/Prattski/HideEmptyCategories/Model/Observer.php</li>
<li>/app/code/local/Prattski/HideEmptyCategories/Model/Catalog/Resource/Category/Flat.php</li>
</ul>
<p>Test it out!  You&#8217;ll be able to see if Magento recognizes your module by going to System > Configuration > Advanced.  If you see the module in the list, Magento knows it&#8217;s there.  You&#8217;ll have to have some categories in your system, some with products in them, some without, to see if it&#8217;s working properly on the frontend.</p>
<p>I hope you enjoyed learning how to build this module.  If you find any issues or bugs, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2011/10/06/magento-module-hide-empty-categories/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Looking For Small/Medium Magento Module Jobs</title>
		<link>http://prattski.com/2011/10/05/looking-for-smallmedium-magento-module-jobs/</link>
		<comments>http://prattski.com/2011/10/05/looking-for-smallmedium-magento-module-jobs/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 01:49:20 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=803</guid>
		<description><![CDATA[I am coming back to the freelance market for a bit, and I am looking for small/medium Magento module jobs. If you or anyone you know needs any work done in this area, please let me know!]]></description>
			<content:encoded><![CDATA[<p>I am coming back to the freelance market for a bit, and I am looking for small/medium Magento module jobs.  If you or anyone you know needs any work done in this area, please <a href="http://prattski.com/magento-development/">let me know</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2011/10/05/looking-for-smallmedium-magento-module-jobs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento: Modify Collection To Include Comma Separated Values From Another Table</title>
		<link>http://prattski.com/2011/09/22/magento-modify-collection-to-include-comma-separated-values-from-another-table/</link>
		<comments>http://prattski.com/2011/09/22/magento-modify-collection-to-include-comma-separated-values-from-another-table/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 19:52:19 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=796</guid>
		<description><![CDATA[It was rather difficult to come up with a title for this post, so I&#8217;m not sure that it is completely accurate. But, I have been working on a module, and I needed to modify the catalog/product collection to add &#8230; <a href="http://prattski.com/2011/09/22/magento-modify-collection-to-include-comma-separated-values-from-another-table/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It was rather difficult to come up with a title for this post, so I&#8217;m not sure that it is completely accurate.  But, I have been working on a module, and I needed to modify the catalog/product collection to add a column that contains comma separated skus of the related products associated to each product.</p>
<p>First step is to get the product collection,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$collection</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/product'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now we need to modify the collection to add a new select column.  The mysql is also important here.  You&#8217;ll see that I&#8217;m using <a href="http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat">GROUP_CONCAT</a> and <a href="http://dev.mysql.com/doc/refman/5.0/en/distinct-optimization.html">DISTINCT</a>, and towards the bottom specifying to group by &#8216;e.entity_id&#8217;.  I&#8217;m not going to dive into why this is necessary or how it all works. You&#8217;ll be better off visiting the mysql documentation on those.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$collection</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/product'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSelect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">columns</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GROUP_CONCAT(DISTINCT (SELECT sku FROM catalog_product_entity WHERE entity_id = r.linked_product_id) SEPARATOR \', \') AS related_skus'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">joinLeft</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'r'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'catalog_product_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r.product_id = e.entity_id AND r.link_type_id = 1'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'e.entity_id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The result of this is an additional field in the collection called &#8216;related_skus&#8217; that is a comma-space separated list of skus that are related products for each product in the collection.</p>
<p>If you want to log the actual query that is generated by this, simply add this line below the code above:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #990000;">log</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSelect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hopefully this helps you in some way!</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2011/09/22/magento-modify-collection-to-include-comma-separated-values-from-another-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Adding/Updating Products with V2 API</title>
		<link>http://prattski.com/2011/09/08/magento-addingupdating-products-with-v2-api/</link>
		<comments>http://prattski.com/2011/09/08/magento-addingupdating-products-with-v2-api/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 15:25:54 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=789</guid>
		<description><![CDATA[Magento unfortunately has virtually no documentation on the V2 API. I needed to prove to someone today that using the V2 API, you can indeed create a product, assign it to 2 or more websites, and set the product price &#8230; <a href="http://prattski.com/2011/09/08/magento-addingupdating-products-with-v2-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Magento unfortunately has virtually no documentation on the V2 API.  I needed to prove to someone today that using the V2 API, you can indeed create a product, assign it to 2 or more websites, and set the product price to different values for each website (as long as you&#8217;ve set the price scope to &#8220;Website&#8221; instead of the default &#8220;Global&#8221; which is in System > Configuration > Catalog > Price).</p>
<p>In this example, I set the initial product data to create, and run the API method &#8216;catalogProductCreate&#8217;. After the product has been created, I then set the product price for the wholesale website, and then run the &#8216;catalogProductUpdate&#8217; method.  The key here is passing in the correct store view code.  Ultimately, the product is created with the price of $45.  Then the wholesale website is updated to set a price of $20.</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>
&nbsp;
<span style="color: #666666; font-style: italic;">//error_reporting(E_ALL);</span>
<span style="color: #666666; font-style: italic;">//ini_set('display_errors', '1');</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Get API Session
 */</span>
<span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SoapClient<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://core.local/api/v2_soap?wsdl=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$session</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'augustash'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Set Product Data
 */</span>
<span style="color: #000088;">$newProductData</span>                     <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> stdClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span>               <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Product Name'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span>        <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Description'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">short_description</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Short Description'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">websites</span>	    <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">categories</span>         <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span>             <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">price</span>              <span style="color: #339933;">=</span> <span style="color: #cc66cc;">45</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tax_class_id</span>       <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">weight</span>             <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Create Product Using V2 API
 */</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">catalogProductCreate</span><span style="color: #009900;">&#40;</span>
    <span style="color: #000088;">$session</span><span style="color: #339933;">,</span>           <span style="color: #666666; font-style: italic;">// Soap Session</span>
    <span style="color: #0000ff;">'simple'</span><span style="color: #339933;">,</span>           <span style="color: #666666; font-style: italic;">// Product Type</span>
    <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span>                  <span style="color: #666666; font-style: italic;">// Attribute Set Id (Default)</span>
    <span style="color: #0000ff;">'product-sku'</span><span style="color: #339933;">,</span>      <span style="color: #666666; font-style: italic;">// Product Sku</span>
    <span style="color: #000088;">$newProductData</span>     <span style="color: #666666; font-style: italic;">// Product Data</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Set Price for Wholesale Website
 */</span>
<span style="color: #000088;">$newProductData</span>         <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> stdClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newProductData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">price</span>  <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Update Product with Wholesale Price using V2 API
 */</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">catalogProductUpdate</span><span style="color: #009900;">&#40;</span>
    <span style="color: #000088;">$session</span><span style="color: #339933;">,</span>           <span style="color: #666666; font-style: italic;">// Soap Session</span>
    <span style="color: #0000ff;">'product-sku'</span><span style="color: #339933;">,</span>      <span style="color: #666666; font-style: italic;">// Product Sku</span>
    <span style="color: #000088;">$newProductData</span><span style="color: #339933;">,</span>    <span style="color: #666666; font-style: italic;">// Product Data</span>
    <span style="color: #0000ff;">'wholesale'</span>         <span style="color: #666666; font-style: italic;">// Store View Code</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * End Session
 */</span>
<span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">endSession</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you are wondering where to look to find out what values you can pass in, and what parameters are needed when making V2 API calls, you&#8217;ll need to look at the wsdl.  In app/code/core/Mage/Catalog/etc/wsdl.xml, you&#8217;ll find the product API info.  I&#8217;ve extracted the product data fields that you can pass in when creating a product:</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;complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;catalogProductCreateEntity&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;all<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;categories&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:ArrayOfString&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;websites&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:ArrayOfString&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;description&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;short_description&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;weight&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;status&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;url_key&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;url_path&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;visibility&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;category_ids&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:ArrayOfString&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;website_ids&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:ArrayOfString&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;has_options&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;gift_message_available&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;price&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;special_price&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;special_from_date&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;special_to_date&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;tax_class_id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;tier_price&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:catalogProductTierPriceEntityArray&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;meta_title&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;meta_keyword&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;meta_description&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;custom_design&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;custom_layout_update&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;options_container&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;additional_attributes&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:associativeArray&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;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;/all<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/complexType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Here are the parameters that can be passed in when using the create and update methods:</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;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;catalogProductCreateRequest&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sessionId&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;type&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;set&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sku&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;productData&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:catalogProductCreateEntity&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;catalogProductUpdateRequest&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sessionId&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;product&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;productData&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;typens:catalogProductCreateEntity&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;storeView&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;productIdentifierType&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2011/09/08/magento-addingupdating-products-with-v2-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento: Bug With Editing Date &amp; Time, Time Custom Options</title>
		<link>http://prattski.com/2011/09/01/magento-bug-with-editing-date-time-time-custom-options/</link>
		<comments>http://prattski.com/2011/09/01/magento-bug-with-editing-date-time-time-custom-options/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 15:24:35 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=784</guid>
		<description><![CDATA[Using Magento 1.5.0.1, I noticed an interesting bug this afternoon. If you have setup any Date &#038; Time or Time custom attributes, and have made them NOT required, here&#8217;s something you may notice: When initially adding the product to the &#8230; <a href="http://prattski.com/2011/09/01/magento-bug-with-editing-date-time-time-custom-options/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using Magento 1.5.0.1, I noticed an interesting bug this afternoon.  If you have setup any Date &#038; Time or Time custom attributes, and have made them NOT required, here&#8217;s something you may notice:</p>
<p>When initially adding the product to the cart, and you leave the Date &#038; Time or Time custom options NOT filled out, your product will be added to the cart just as you would expect.  The untouched custom options are not applied to the product in your cart.  However, in the rare case where a user is clicking the &#8220;Edit&#8221; link in the cart to edit it, and you still leave those custom options untouched, the validation will bark at you saying &#8220;Field is not complete&#8221; on those custom options.  The only way to edit that product then is to put values in for those fields.  Magento updates the product as it should, but you now have those other custom options in play, which could screw things up.</p>
<p>I have submitted the bug to Magento:  http://www.magentocommerce.com/bug-tracking/issue?issue=12183</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2011/09/01/magento-bug-with-editing-date-time-time-custom-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

