<?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>SpinOneSolutions &#187; Override</title>
	<atom:link href="http://www.spinonesolutions.com/tag/override/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spinonesolutions.com</link>
	<description>I waste my time so that you don't have to...</description>
	<lastBuildDate>Mon, 16 May 2011 17:01:16 +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 Controller Override</title>
		<link>http://www.spinonesolutions.com/2010/03/magento-controller-override/</link>
		<comments>http://www.spinonesolutions.com/2010/03/magento-controller-override/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 16:00:11 +0000</pubDate>
		<dc:creator>Will Wright</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[Override]]></category>

		<guid isPermaLink="false">http://www.spinonesolutions.com/?p=511</guid>
		<description><![CDATA[The Problem: You want to override a Controller&#8217;s action with a custom action. Magento Enterprise v1.6.0.0 The Solution: I ran into some issues trying to override a controller&#8217;s action yesterday. I think it mainly stems from a version change, but at any rate here&#8217;s the &#8220;new&#8221; way to do it. This comes from a helpful [...]]]></description>
			<content:encoded><![CDATA[<h3>The Problem:</h3>
<p>You want to override a Controller&#8217;s action with a custom action.</p>
<p>Magento Enterprise v1.6.0.0</p>
<h3>The Solution:</h3>
<p>I ran into some issues trying to override a controller&#8217;s action yesterday. I think it mainly stems from a version change, but at any rate here&#8217;s the &#8220;new&#8221; way to do it. This comes from a helpful <a href="http://www.magentocommerce.com/boards/viewthread/37244/">post</a> on the Magento forums.</p>
<p>In this example my custom modules&#8217;s namespace is &#8220;Spinonesolutions&#8221; and I&#8217;m going to override the <strong>createPostAction</strong> in <strong>Mage_Customer_AccountController.</strong></p>
<p>Start by creating a bare bones custom module; if you don&#8217;t know how to do this check out <a title="Magento – Part I : Custom Module" href="http://www.spinonesolutions.com/2009/09/magento-custom-module-part-i/">Magento – Part I : Custom Module</a>.</p>
<p>I&#8217;ve only got two files in my custom module; <strong>controllers/AccountController.php</strong> and <strong>etc/config.xml</strong>.</p>
<p>config.xml:</p>
<pre class="php" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;config&gt;
&lt;modules&gt;
  &lt;Spinonesolutions_Customer&gt;
    &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;/Spinonesolutions_Customer&gt;
&lt;/modules&gt;
&lt;frontend&gt;
  &lt;routers&gt;
    &lt;!-- This is the frontname to override
    EG: http://mydomainname.com/customer/  --&gt;
    &lt;customer&gt;
      &lt;args&gt;
        &lt;modules&gt;
          &lt;!-- Use the module Spinonesolutions_Customer BEFORE Mage_Customer --&gt;
          &lt;Spinonesolutions_Customer before="Mage_Customer"&gt;Spinonesolutions_Customer&lt;/Spinonesolutions_Customer&gt;
        &lt;/modules&gt;
      &lt;/args&gt;
    &lt;/customer&gt;
  &lt;/routers&gt;
&lt;/frontend&gt;
&lt;/config&gt;</pre>
<p>AccountController.php:</p>
<pre class="php" name="code">&lt;?php
/**
* Override Customer AccountController
*
* Override the createPost action
*
* @category Mage
* @package Mage_Customer
* @author Will Wright
*/

/*Controllers aren't included automatically, so we include it here so that we can extend it*/
include_once("Mage/Customer/controllers/AccountController.php");
class Spinonesolutions_Customer_AccountController extends Mage_Customer_AccountController {
  public function createPostAction() {
    die('here');
  }
}</pre>
<p>That&#8217;s it!  You should now have a working override.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spinonesolutions.com/2010/03/magento-controller-override/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

