<?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>Solution Log &#124; Antonio David - NVNCBL &#187; Programming</title>
	<atom:link href="http://www.nvncbl.com/categories/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nvncbl.com</link>
	<description>A place to log my programming solutions for future reference</description>
	<lastBuildDate>Mon, 17 May 2010 21:39:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento Custom Module Block, Controller, Model, etc. Not Working</title>
		<link>http://www.nvncbl.com/2010/05/magento-custom-module-block-controller-model-etc-not-working/</link>
		<comments>http://www.nvncbl.com/2010/05/magento-custom-module-block-controller-model-etc-not-working/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:39:17 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[controllers]]></category>
		<category><![CDATA[custom module]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[permissions]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=566</guid>
		<description><![CDATA[Just a little tip.  When you&#8217;re frustrated as to why Magento isn&#8217;t loading your Company/Module/Block/*, Company/Module/Model/*, Company/Module/controllers/*, etc. files for some strange reason:
Make sure the file permissions are set correctly.
(0777 might be too generous, but we don&#8217;t have time to figure these things out for sure).
This happened to me today.  Turns out my [...]]]></description>
			<content:encoded><![CDATA[<p>Just a little tip.  When you&#8217;re frustrated as to why Magento isn&#8217;t loading your Company/Module/Block/*, Company/Module/Model/*, Company/Module/controllers/*, etc. files for some strange reason:</p>
<blockquote><p>Make sure the file permissions are set correctly.</p></blockquote>
<p>(0777 might be too generous, but we don&#8217;t have time to figure these things out for sure).</p>
<p>This happened to me today.  Turns out my IDE (NuSphere&#8217;s PhpEd, an excellent PHP IDE by the way) has a setting for default folder/file permissions when creating new files.  Insufficient file permissions were manifesting themselves as &#8220;Invalid block type &#8230;&#8221; errors.  I&#8217;m sure it could be responsible for other quirkiness when doing custom work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/05/magento-custom-module-block-controller-model-etc-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You Know You&#8217;re Deep in Magento When..</title>
		<link>http://www.nvncbl.com/2010/05/you-know-youre-deep-in-magento-when/</link>
		<comments>http://www.nvncbl.com/2010/05/you-know-youre-deep-in-magento-when/#comments</comments>
		<pubDate>Thu, 13 May 2010 17:23:03 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Geek / Humor]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[abstract.php]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=562</guid>
		<description><![CDATA[You know you&#8217;re deep in Magento when you have a file an Abstract.php open.  Or in a Mysql4 folder.
Or when one of your eyes starts twitching.
*sigh*
]]></description>
			<content:encoded><![CDATA[<p>You know you&#8217;re deep in Magento when you have a file an Abstract.php open.  Or in a Mysql4 folder.</p>
<p>Or when one of your eyes starts twitching.</p>
<p>*sigh*</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/05/you-know-youre-deep-in-magento-when/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Accept Payments via Authorize.net</title>
		<link>http://www.nvncbl.com/2010/03/magento-accept-payments-via-authorize-net/</link>
		<comments>http://www.nvncbl.com/2010/03/magento-accept-payments-via-authorize-net/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 18:59:14 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[authorize.net]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[payment gateway]]></category>
		<category><![CDATA[payment module]]></category>
		<category><![CDATA[redstage]]></category>
		<category><![CDATA[transaction]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=555</guid>
		<description><![CDATA[Use this resource “How to Set Up Authorize.net Payment Gateway” at Redstage&#8217;s Magento Blog for more information on how to set up the Authorize.net payment module in Magento.  The article shows where to get the API and Transaction Keys, as well as where to enter them into Magento.
As with most payment gateways, the steps [...]]]></description>
			<content:encoded><![CDATA[<p>Use this resource “<a href="http://www.redstage.com/magento/blog/2010/03/29/how-to-set-up-authorize-net-payment-gateway/" class="external">How to Set Up Authorize.net Payment Gateway</a>” at Redstage&#8217;s <a href="http://www.redstage.com/magento/blog/" class="external">Magento Blog</a> for more information on how to set up the <a href="http://www.authorize.net/" class="external">Authorize.net</a> payment module in Magento.  The article shows where to get the API and Transaction Keys, as well as where to enter them into Magento.</p>
<p>As with most payment gateways, the steps involved are a matter of:</p>
<ol>
<li>Gathering the appropriate information (provided by the gateway service)</li>
<li>Enter the information into the Magento Admin Panel</li>
<li>Activate the payment module</li>
</ol>
<p><a href="http://www.redstage.com/magento/blog/2010/03/29/how-to-set-up-authorize-net-payment-gateway/" class="external">Full procedure</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/magento-accept-payments-via-authorize-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Add Custom Category Attributes</title>
		<link>http://www.nvncbl.com/2010/03/magento-add-custom-category-attributes/</link>
		<comments>http://www.nvncbl.com/2010/03/magento-add-custom-category-attributes/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 02:54:58 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=527</guid>
		<description><![CDATA[A client wanted to add a description to each of his product categories, such that the first built-in description would be above the product listing, and the second description would be below the product listing.  Rather than have them create static blocks for every category, it was obvious that I&#8217;d have to create a new [...]]]></description>
			<content:encoded><![CDATA[<p>A client wanted to add a description to each of his product categories, such that the first built-in description would be above the product listing, and the second description would be below the product listing.  Rather than have them create static blocks for every category, it was obvious that I&#8217;d have to create a new category attribute.</p>
<p>Fortunately, I stumbled upon one possible solution.  The method doesn&#8217;t involve creating a full-blown module, rather, just a few database modifications using phpMyAdmin.</p>
<p>Summarized, the process comes down to:</p>
<ol>
<li>Create a new row in the eav_attribute table, one that mimics a category&#8217;s meta-description attribute with everything being the same except for a unique identifier and a label.</li>
<li>Create a new row in the eav_entity_attribute table, to provide a sort order for your newly created attribute, following in the format footsteps of the existing rows.</li>
</ol>
<p>For the fully detailed procedure, see <a class="external" title="Create Custom Category Attributes with phpMyAdmin" href="http://www.knowmagento.com/2009/06/19/custom-category-attributes-with-phpmyadmin/">Create Custom Category Attributes with phpMyAdmin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/magento-add-custom-category-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Resetting Admin Password</title>
		<link>http://www.nvncbl.com/2010/03/magento-resetting-admin-password/</link>
		<comments>http://www.nvncbl.com/2010/03/magento-resetting-admin-password/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 17:52:30 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[redstage]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=536</guid>
		<description><![CDATA[Handy if you (or a client) is locked out, here&#8217;s how to reset the admin password, posted on Redstage&#8217;s Magento Blog.
Basically, the procedure involves going into the database, finding the appropriate row that contains the password, and assigning the new password using MD5.
]]></description>
			<content:encoded><![CDATA[<p>Handy if you (or a client) is locked out, here&#8217;s <a title="How to Reset the Admin Password" href="http://www.redstage.com/magento/blog/2010/03/11/magento-how-to-reset-the-admin-password/">how to reset the admin password</a>, posted on Redstage&#8217;s <a title="Redstage Magento Blog" href="http://www.redstage.com/magento/blog">Magento Blog</a>.</p>
<p>Basically, the procedure involves going into the database, finding the appropriate row that contains the password, and assigning the new password using MD5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/magento-resetting-admin-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Set Product Dropdown and Multiselect Values Programmatically</title>
		<link>http://www.nvncbl.com/2010/03/magento-set-product-dropdown-and-multiselect-values-programmatically/</link>
		<comments>http://www.nvncbl.com/2010/03/magento-set-product-dropdown-and-multiselect-values-programmatically/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:02:17 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[addData]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[multiselect]]></category>
		<category><![CDATA[programmatically]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[values]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=513</guid>
		<description><![CDATA[Here&#8217;s how to programmatically, meaning through code, set a product&#8217;s attribute value when the attribute is of type Dropdown or Multiselect.  For dropdown, we&#8217;ll be interested in setting only a single value.  And obviously for multiselect, we&#8217;ll be interested in setting multiple values.
With Text attributes such as Name and Description, you can do something like:

$product-&#62;setName&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to programmatically, meaning through code, set a product&#8217;s attribute value when the attribute is of type Dropdown or Multiselect.  For dropdown, we&#8217;ll be interested in setting only a single value.  And obviously for multiselect, we&#8217;ll be interested in setting multiple values.</p>
<p>With Text attributes such as Name and Description, you can do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setName</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'My Sweet Shirt'</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;">setDescription</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'This shirt will make you look good, thus impressing girls.'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Unfortunately, this won&#8217;t work for attributes whose values are predefined.  Instead of cursing Magento, think of it as a data-integrity/validation measure.</p>
<p>Anyway, assuming you already have a $product object, our overall process will be to:</p>
<ol>
<li>Load an attribute object for the attribute you want to work on</li>
<li>Load the collection of that attribute&#8217;s values</li>
<li>Make your choices (different for Dropdown and Multiselect)</li>
<li>Save the product</li>
</ol>
<p><strong>1. Load an attribute object for the attribute you want to work on</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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;">'eav/entity_attribute'</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;">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></pre></div></div>

<p><strong>2. Load the collection of that attribute&#8217;s values</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$values</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;">$valuesCollection</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_option_collection'</span><span style="color: #009900;">&#41;</span>
	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttributeFilter</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attribute</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;">-&gt;</span><span style="color: #004000;">setStoreFilter</span><span style="color: #009900;">&#40;</span> Mage_Core_Model_App<span style="color: #339933;">::</span><span style="color: #004000;">ADMIN_STORE_ID</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;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</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;">$valuesCollection</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: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getValue</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: #000088;">$item</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></pre></div></div>

<p><strong>3. Make your choice &#8211; DROPDOWN</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setColor</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Blue'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// just do whatever you need to code 'Blue' instead of hard-coding it</span></pre></div></div>

<p><strong>3. Make your choices &#8211; MULTISELECT</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addData</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'color'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Blue'</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;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Red'</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;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Black'</span><span style="color: #009900;">&#93;</span>  <span style="color: #666666; font-style: italic;">// just putting together a comma-separated list of values</span>
<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>4. Save the product</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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></pre></div></div>

<p>This builds off the solution posted by member &#8220;icvu&#8221; here: <a href="http://www.magentocommerce.com/boards/main.php/viewthread/69925/" class="external">http://www.magentocommerce.com/boards/main.php/viewthread/69925/</a> &#8212; specifically the addData() part.</p>
<p>Thanks, and have fun setting attribute values.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/magento-set-product-dropdown-and-multiselect-values-programmatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ConstantContact Send Welcome Email When Creating a New Contact via API</title>
		<link>http://www.nvncbl.com/2010/03/constantcontact-send-welcome-email-when-creating-a-new-contact-via-api/</link>
		<comments>http://www.nvncbl.com/2010/03/constantcontact-send-welcome-email-when-creating-a-new-contact-via-api/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 17:34:32 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[autoresponder]]></category>
		<category><![CDATA[constantcontact]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[mailing list]]></category>
		<category><![CDATA[welcome email]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=507</guid>
		<description><![CDATA[Using the ConstantContact mailing list, I was having trouble getting the welcome email to send after creating a new contact through the API.  I had tried checking the &#8220;Autoresponder&#8221; box in the admin panel, but still no welcome email.  The solution is to have:

var $actionBy = 'ACTION_BY_CONTACT';

in cc_class.php (provided via the &#8220;PHP Sample [...]]]></description>
			<content:encoded><![CDATA[<p>Using the ConstantContact mailing list, I was having trouble getting the welcome email to send after creating a new contact through the API.  I had tried checking the &#8220;Autoresponder&#8221; box in the admin panel, but still no welcome email.  The solution is to have:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$actionBy</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ACTION_BY_CONTACT'</span><span style="color: #339933;">;</span></pre></div></div>

<p>in cc_class.php (provided via the &#8220;<a href="http://developer.constantcontact.com/samples/upload_forms" class="external">PHP Sample Forms</a>&#8221; zip file).  By default, this value is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$actionBy</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ACTION_BY_CUSTOMER'</span></pre></div></div>

<p> instead, which does not trigger the welcome email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/constantcontact-send-welcome-email-when-creating-a-new-contact-via-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refresh Magento Cache Programmatically</title>
		<link>http://www.nvncbl.com/2010/03/refresh-magento-cache-programmatically/</link>
		<comments>http://www.nvncbl.com/2010/03/refresh-magento-cache-programmatically/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 04:16:45 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[catalog]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[inventory]]></category>
		<category><![CDATA[layered navigation]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[rebuild]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=488</guid>
		<description><![CDATA[When writing processes to automate some of Magento&#8217;s normally laborious tasks, perhaps for a product-import script, a mass attribute update script, category import, or inventory adjustment, keep in mind that you may have to refresh some kind of cache &#8212; especially when working with attributes.  If you are encountering quirks or inconsistencies with your [...]]]></description>
			<content:encoded><![CDATA[<p>When writing processes to automate some of Magento&#8217;s normally laborious tasks, perhaps for a product-import script, a mass attribute update script, category import, or inventory adjustment, keep in mind that you may have to refresh some kind of cache &#8212; especially when working with attributes.  If you are encountering quirks or inconsistencies with your data, try these:</p>
<ul>
<li>Rebuild Catalog Index

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/index'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rebuild</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>Rebuild Flat Catalog Product

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">getResourceModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/product_flat_indexer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rebuild</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>Inventory Stock

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cataloginventory/stock_status'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rebuild</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
</ul>
<p>For more cache refreshes, such as:</p>
<ul>
<li>Catalog Rewrites</li>
<li>Layered Navigation Indices</li>
<li>Product Image</li>
<li>Search Index</li>
</ul>
<p>&#8230; please refer to the source of this knowledge <a class="external" title="Magento Refresh Cache" href="http://www.magentocommerce.com/boards/viewthread/43238/#t156277" target="_blank">http://www.magentocommerce.com/boards/viewthread/43238/#t156277</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/03/refresh-magento-cache-programmatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Center Align a UL Menu</title>
		<link>http://www.nvncbl.com/2010/02/center-align-a-ul-menu/</link>
		<comments>http://www.nvncbl.com/2010/02/center-align-a-ul-menu/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 19:08:22 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[ul]]></category>
		<category><![CDATA[unordered list]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=494</guid>
		<description><![CDATA[The task of center-aligning an unordered list (which can&#8217;t have its width explicitly set) via CSS comes up every now and then.  Logging it here for later.
&#8220;For a start you could text-align: center the ul inside the #ul_container_div and display: inline the li instead of floating them left.&#8221;

#ul_container_div&#123; width:100%; text-align:center; &#125;
#ul_container_div li &#123; display: [...]]]></description>
			<content:encoded><![CDATA[<p>The task of center-aligning an unordered list (which can&#8217;t have its width explicitly set) via CSS comes up every now and then.  Logging it here for later.</p>
<p>&#8220;For a start you could text-align: center the ul inside the #ul_container_div and display: inline the li instead of floating them left.&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#ul_container_div</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#ul_container_div</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Source of knowledge: <a class="external" href="http://archivist.incutio.com/viewlist/css-discuss/59041">http://archivist.incutio.com/viewlist/css-discuss/59041</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/02/center-align-a-ul-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 Phantom Text / Duplicate Text Bug</title>
		<link>http://www.nvncbl.com/2010/02/ie6-phantom-text-duplicate-text-bug/</link>
		<comments>http://www.nvncbl.com/2010/02/ie6-phantom-text-duplicate-text-bug/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:56:31 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[internet explorer 6]]></category>
		<category><![CDATA[phantom]]></category>
		<category><![CDATA[repeated]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=490</guid>
		<description><![CDATA[Just for purposes of documenting this useful knowledge:
When viewing in Internet Explorer 6 and experiencing the &#8220;strange-repeated-text&#8221; problem, try applying this CSS to the element containing the text that gets repeated:
float: none;
clear: both;
Knowledge from: http://uxdev.blogspot.com/2008/10/phantom-text-in-ie6.html
]]></description>
			<content:encoded><![CDATA[<p>Just for purposes of documenting this useful knowledge:</p>
<p>When viewing in Internet Explorer 6 and experiencing the &#8220;strange-repeated-text&#8221; problem, try applying this CSS to the element containing the text that gets repeated:</p>
<p>float: none;<br />
clear: both;</p>
<p>Knowledge from: <a class="external" href="http://uxdev.blogspot.com/2008/10/phantom-text-in-ie6.html">http://uxdev.blogspot.com/2008/10/phantom-text-in-ie6.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2010/02/ie6-phantom-text-duplicate-text-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force IE8 to Render Like IE7</title>
		<link>http://www.nvncbl.com/2009/12/force-ie8-torender-like-ie7/</link>
		<comments>http://www.nvncbl.com/2009/12/force-ie8-torender-like-ie7/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 17:15:51 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[friend connect]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=471</guid>
		<description><![CDATA[Found this little snippet yesterday.  I&#8217;m not saying that this is best practice in any way, but if you&#8217;re looking for a quick fix, here it is:

&#60;meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/&#62;

I think this has the effect of enabling &#8220;Compatibility Mode&#8221; that the user would normally have to turn on.
As a side note, the specific reason I [...]]]></description>
			<content:encoded><![CDATA[<p>Found this little snippet yesterday.  I&#8217;m not saying that this is best practice in any way, but if you&#8217;re looking for a quick fix, here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'IE=EmulateIE7'</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'X-UA-Compatible'</span><span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>I think this has the effect of enabling &#8220;Compatibility Mode&#8221; that the user would normally have to turn on.</p>
<p>As a side note, the specific reason I used this was to make a Google Friend Connect widget render properly &#8212; there are plenty of posts on the web about those widgets not working in IE8.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/12/force-ie8-torender-like-ie7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento $this-&gt;getSkinUrl() Wrong Template</title>
		<link>http://www.nvncbl.com/2009/10/magento-this-getskinurl-wrong-template/</link>
		<comments>http://www.nvncbl.com/2009/10/magento-this-getskinurl-wrong-template/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 15:39:08 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=463</guid>
		<description><![CDATA[When using $this-&#62;getSkinUrl(&#8216;path/to/yourfile.html&#8217;) inside view (.phtml) code, and you&#8217;re getting /default/default/ instead of /default/yourtheme, this isn&#8217;t Magento working incorrectly.  Check the $argument you send and verify that the target file actually exists.
getSkinUrl() does more than just generate the proper URL, it also verifies that the file exists.  If it doesn&#8217;t find the file within the [...]]]></description>
			<content:encoded><![CDATA[<p>When using $this-&gt;getSkinUrl(&#8216;path/to/yourfile.html&#8217;) inside view (.phtml) code, and you&#8217;re getting /default/default/ instead of /default/yourtheme, this isn&#8217;t Magento working incorrectly.  Check the $argument you send and verify that the target file actually exists.</p>
<p>getSkinUrl() does more than just generate the proper URL, it also verifies that the file exists.  If it doesn&#8217;t find the file within the store&#8217;s /yourtheme folder, it will revert to /default.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/10/magento-this-getskinurl-wrong-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script Double Run / Double Execute Phenomenon</title>
		<link>http://www.nvncbl.com/2009/10/script-double-run-double-execute-phenomenon/</link>
		<comments>http://www.nvncbl.com/2009/10/script-double-run-double-execute-phenomenon/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:05:29 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[double execute]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[src]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=458</guid>
		<description><![CDATA[I had a problem with your PHP code running or executing seemingly twice.  To debug this phenomenon, I put some write-to-file code at the beginning of the script.  Surprisingly, whenever I loaded my script in the browser, the file would be written to twice despite my one page load.
The problem was that The page I [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem with your PHP code running or executing seemingly twice.  To debug this phenomenon, I put some write-to-file code at the beginning of the script.  Surprisingly, whenever I loaded my script in the browser, the file would be written to twice despite my one page load.</p>
<p>The problem was that The page I was developing had an &lt;img&gt; in it with the &#8220;src&#8221; attribute set blank.  When the document was fully loaded, javascript was in place to dynamically assign the &#8220;src&#8221;.  This worked perfectly fine in the pre-server-side-logic stage of development so it was an easy decision to begin debugging server-side logic.</p>
<p>The double execute happens when Firefox sees &lt;img src=&#8221;" /&gt;.  Not knowing what source to assign, it sends a request (the second request) to the current path (again) for the image.  Therein lies the problem.  It&#8217;s interesting to note that Firefox is not to blame, as it&#8217;s following HTML specification.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/10/script-double-run-double-execute-phenomenon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Magento Widgets</title>
		<link>http://www.nvncbl.com/2009/10/introducing-magento-widgets/</link>
		<comments>http://www.nvncbl.com/2009/10/introducing-magento-widgets/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:19:12 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=451</guid>
		<description><![CDATA[Magento Widgets allow business users with no technical knowledge to easily add dynamic content (including product data, for example) to pages in Magento Stores.  This allows for greater control and flexibility in creating informational and marketing content through administrator tools, enabling intuitive and efficient control of content such as:

Dynamic product data in Marketing Campaign Landing [...]]]></description>
			<content:encoded><![CDATA[<p>Magento Widgets allow business users with no technical knowledge to easily add dynamic content (including product data, for example) to pages in Magento Stores.  This allows for greater control and flexibility in creating informational and marketing content through administrator tools, enabling intuitive and efficient control of content<span id="more-451"></span> such as:</p>
<ul>
<li>Dynamic product data in Marketing Campaign Landing Pages</li>
<li>Dynamic Information such as Recently Viewed Items into Content Pages</li>
<li>Promotional images to position in different blocks, side columns and other locations throughout the storefront</li>
<li>Interactive elements and action blocks (external review systems, video chats, voting and subscription forms)</li>
<li>Alternative navigation elements (tag clouds, catalog image sliders)</li>
<li>Create interactive and dynamic flash elements easily configured and embedded within content pages for enhanced user experience</li>
</ul>
<p>Originally posted on the <a class="external" href="http://www.magentocommerce.com/blog/comments/introducing-magento-widgets/">official Magento Blog</a>.  Continue reading for more on:</p>
<ul>
<li>What are Widgets?</li>
<li>How to Develop a Widget</li>
<li>Terminology</li>
<li>Widget Examples in Magento CE 1.4, EE 1.6</li>
</ul>
<p>Widget ideas anyone?  What should I work on?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/10/introducing-magento-widgets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento Clear Shopping Cart and Session</title>
		<link>http://www.nvncbl.com/2009/09/magento-clear-shopping-cart-and-session/</link>
		<comments>http://www.nvncbl.com/2009/09/magento-clear-shopping-cart-and-session/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 04:29:21 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[shopping cart]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=410</guid>
		<description><![CDATA[If you ever need to programmatically clear Magento&#8217;s shopping cart, use the snippet of code below.  If you need to clear the user&#8217;s entire session, including the shopping cart, shipping information, billing information and chosen payment methods, please refer to the snippet further below.
Clear shopping cart

foreach&#40; Mage::getSingleton&#40;'checkout/session'&#41;-&#62;getQuote&#40;&#41;-&#62;getItemsCollection&#40;&#41; as $item &#41;&#123;
    Mage::getSingleton&#40;'checkout/cart'&#41;-&#62;removeItem&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever need to programmatically clear Magento&#8217;s shopping cart, use the snippet of code below.  If you need to clear the user&#8217;s entire session, including the shopping cart, shipping information, billing information and chosen payment methods, please refer to the snippet further below.</p>
<p><span id="more-410"></span><strong>Clear shopping cart</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'checkout/session'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuote</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getItemsCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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>
    Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'checkout/cart'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">removeItem</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$item</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;">-&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><strong>Clear entire session</strong></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;">getSingleton</span><span style="color: #009900;">&#40;</span>‘checkout<span style="color: #339933;">/</span>session’<span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/09/magento-clear-shopping-cart-and-session/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento Skip Login/Registration at Checkout</title>
		<link>http://www.nvncbl.com/2009/09/magento-skip-loginregistration-at-checkout/</link>
		<comments>http://www.nvncbl.com/2009/09/magento-skip-loginregistration-at-checkout/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:05:13 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[onepage]]></category>
		<category><![CDATA[register]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=397</guid>
		<description><![CDATA[A client wanted every checkout on his site to be a guest checkout.  He was selling a very niche product and wanted to avoid hassling potential customers with a user log-in or registration form.  The goal was to modify Magento&#8217;s One Page Checkout to completely skip Step 1: Login/Register and show Step 2: [...]]]></description>
			<content:encoded><![CDATA[<p>A client wanted every checkout on his site to be a guest checkout.  He was selling a very niche product and wanted to avoid hassling potential customers with a user log-in or registration form.  The goal was to modify Magento&#8217;s One Page Checkout to completely skip Step 1: Login/Register and show Step 2: Billing Information.</p>
<p><span id="more-397"></span>We are going to:</p>
<ol>
<li>Hide Step 1</li>
<li>Tell Magento that Step 1 was &#8220;completed&#8221; as Guest</li>
<li>Have Step 2 appear as Step 1</li>
</ol>
<p>Here goes:</p>
<p><strong>1. Hiding Step 1 &#8211; Login/Register</strong></p>
<p>Open /app/design/frontend/&lt;your_company&gt;/&lt;your_company&gt;/template/checkout/onepage.phtml</p>
<p>Find:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;opc-&lt;?php echo $_stepId ?&gt;</span></span>&quot; {...}</pre></div></div>

<p>And replace it with:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> &lt;?php echo $i<span style="color: #66cc66;">==</span><span style="color: #cc66cc;">1</span> ? <span style="color: #ff0000;">'style=&quot;display:none;&quot;'</span> : <span style="color: #ff0000;">''</span> ?&gt;</span> id=&quot;opc-<span style="color: #009900;">&lt;?php echo $_stepId ?&gt;</span>&quot;  {...}</pre></div></div>

<p><strong>2. Set Step 1 to equal Guest</strong></p>
<p>Open /app/design/frontend/&lt;your_company&gt;/&lt;your_company&gt;/template/checkout/onepage/login.phtml</p>
<p>Basically, comment everything out and insert:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkout_method&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login:guest&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;guest&quot;</span> <span style="color: #000066;">checked</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checked&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
Event.observe(window, 'load', function() {
checkout.setMethod();
});
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p><strong>3. Make Step 2 look like Step 1</strong></p>
<p>Open /app/design/frontend/&lt;your_company&gt;/&lt;your_company&gt;/template/checkout/onepage.phtml</p>
<p>Find:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</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><span style="color: #004000;">getSteps</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_stepId</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$_stepInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span></pre></div></div>

<p>And replace it with:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span><span style="color: #339933;">=-</span><span style="color: #cc66cc;">1</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><span style="color: #004000;">getSteps</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_stepId</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$_stepInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span></pre></div></div>

<p>Finally, in the same file, change this snippet that we added in step 1:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span></pre></div></div>

<p>to:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span></pre></div></div>

<p>And there you have it.  Credit goes to poster <a class="external" href="http://www.imagebox.com">imagebox</a> on this particular Magento <a class="external" href="http://www.magentocommerce.com/boards/viewthread/17873/#t116490">how-to thread</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/09/magento-skip-loginregistration-at-checkout/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Clear Magento Customers, Orders, Searches, and Tags</title>
		<link>http://www.nvncbl.com/2009/08/clear-magento-customers-orders-searches-and-tags/</link>
		<comments>http://www.nvncbl.com/2009/08/clear-magento-customers-orders-searches-and-tags/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:55:07 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[orders]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=370</guid>
		<description><![CDATA[From the Magento dashboard, there is no intuitive way of deleting/clearing/resetting customer, order, search, or tag data.  As developers, we have to test the various functions of our specific Magento setup before presenting it to the client.  Before the site can go live, all of the test data has to be removed so [...]]]></description>
			<content:encoded><![CDATA[<p>From the Magento dashboard, there is no intuitive way of deleting/clearing/resetting customer, order, search, or tag data.  As developers, we have to test the various functions of our specific Magento setup before presenting it to the client.  Before the site can go live, all of the test data has to be removed so it doesn&#8217;t interfere with the client&#8217;s other business functions such as accounting and inventory.</p>
<p><span id="more-370"></span>Fortunately, removing test data is as easy as running SQL queries:</p>
<p><strong>Clear customers:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`customer_entity`</span></pre></div></div>

<p><strong>Clear orders:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`sales_order`</span></pre></div></div>

<p><strong>Clear searches:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`catalogsearch_query`</span></pre></div></div>

<p><strong>Clear tags:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`tag`</span>
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`tag_relation`</span></pre></div></div>

<p>You might have expected to meddle with other tables, like all the `sales_order_*` or `customer_entity_*` tables.  However, thanks to the database&#8217;s various constraints, any related rows are automatically deleted thus preventing orphan data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/08/clear-magento-customers-orders-searches-and-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento Configurable Product Pricing</title>
		<link>http://www.nvncbl.com/2009/08/magento-configurable-product-pricing/</link>
		<comments>http://www.nvncbl.com/2009/08/magento-configurable-product-pricing/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 18:04:54 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[configurable]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[prices]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=356</guid>
		<description><![CDATA[Let&#8217;s say for example that configurable product A is defined to have 2 attributes &#8220;color&#8221; and &#8220;size&#8221;.  Values for color may be: Black, White, Chrome while values for size may be: 1&#8243;, 2&#8243;, 3&#8243;, and 4&#8243;.
One would expect that there should be a price matrix that might look like:




1&#8243;
2&#8243;
3&#8243;
4&#8243;


Black
$1.00
$1.20
$1.40
$1.60


White
$1.05
$1.25
$1.45
$1.65


Chrome
$1.15
$1.35
$1.55
$1.75



But if you only have simple products:
Black [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say for example that configurable product A is defined to have 2 attributes &#8220;color&#8221; and &#8220;size&#8221;.  Values for color may be: <strong>Black</strong>, <strong>White</strong>, <strong>Chrome</strong> while values for size may be: <strong>1&#8243;</strong>, <strong>2&#8243;</strong>, <strong>3&#8243;</strong>, and <strong>4&#8243;</strong>.</p>
<p>One would expect that there should be a price matrix that might look like:</p>
<table border="0">
<tbody>
<tr>
<th></th>
<th>1&#8243;</th>
<th>2&#8243;</th>
<th>3&#8243;</th>
<th>4&#8243;</th>
</tr>
<tr>
<th>Black</th>
<td>$1.00</td>
<td>$1.20</td>
<td>$1.40</td>
<td>$1.60</td>
</tr>
<tr>
<th>White</th>
<td>$1.05</td>
<td>$1.25</td>
<td>$1.45</td>
<td>$1.65</td>
</tr>
<tr>
<th>Chrome</th>
<td>$1.15</td>
<td>$1.35</td>
<td>$1.55</td>
<td>$1.75</td>
</tr>
</tbody>
</table>
<p><span id="more-356"></span>But if you only have simple products:</p>
<p>Black + 1&#8243; = $1.00<br />
Black + 3&#8243; = $1.40<br />
White + 1&#8243; = $1.05<br />
White + 2&#8243; = $1.25<br />
Chrome + 3&#8243; = $1.55<br />
Chrome + 4&#8243; = $1.75</p>
<p>&#8230; then you don&#8217;t need the full matrix.  Even if you did need the full matrix, how do you set up simple/configurable product pricing in Magento?</p>
<p><strong>Solution:</strong></p>
<p>This <a title="Simple Configurable Products" href="http://www.magentocommerce.com/extension/596/simple-configurable-products" class="external">Simple Configurable Products</a> extension by Matt Dean.  From the extension page:</p>
<blockquote><p>This extension changes the way that the pricing of configurable products works in Magento. With this extension enabled, a configurable product&#8217;s own price is never used. Instead, the price used is that of the appropriate associated simple product.</p>
<p>This gives site owners direct control to set the price of every configuration of a product, while still giving users the flexibility they usually get with configurable products. (There&#8217;s no more having to set rules such as: +20% for blue, -£10 for small, +15% for leather. You just price the underlying small-blue-leather product at £199.99 and that&#8217;s what the user pays.)</p></blockquote>
<p>You still have to create the configurable products and set certain attributes to be the configurable ones ( e.g. &#8220;Color&#8221; and &#8220;Size&#8221; in the previous example ).  Set the prices of simple products (no need to set the price of configurable products), and the extension takes care of the rest.  In the front-end, users will still be specifying Color and Size, and prices will change accordingly.</p>
<p>Happy pricing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2009/08/magento-configurable-product-pricing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
