I'm trying to rewrite the getCheckoutUrl() functions in
Mage/Checkout/Blocks/Onepage/Link.php
and
Mage/Checkout/Helper/Url.php
but the rewrites don't seem to work.
My config.xml file contains the following:
...
<global>
...
<blocks>
<stores>
<class>Zzyzzx_Stores_Block</class>
</stores>
<checkout>
<rewrite>
<onepage_link>Zzyzzx_Stores_Block_Link</onepage_link>
</rewrite>
</checkout>
</blocks>
<helpers>
<stores>
<class>Zzyzzx_Stores_Helper</class>
</stores>
<checkout>
<rewrite>
<url>Zzyzzx_Stores_Helper_Url</url>
</rewrite>
</checkout>
</helpers>
...
</global>
...
Everything else defined in the ocnfig seems to be working fine, only the rewrites don't seem to.
the block rewrite refers to my file
.../app/code/community/Zzyzzx/Stores/Block/Link.php
which contains:
class Zzyzzx_Stores_Block_Link extends Mage_Checkout_Block_Onepage_Link
{
function getCheckoutUrl()
{
//my changes
}
}
the helpers rewrite refers to
.../app/code/community/Zzyzzx/Stores/Helper/Url.php
which contains:
class Zzyzzx_Stores_Helper_Url extends Mage_Checkout_Helper_Url
{
function getCheckoutUrl()
{
//my changes
}
}
with the helper, I am able to directly access the function with Mage::helper("stores/url")->getCheckoutUrl();
but the rewrite doesn't work.
Where am I going wrong? How do I get my rewrites working?
config.xml
is picked up. modify it so it will have an error (unclosed tag for example) and see if you get an error in the page. Also a common mistake can be in the declaration fileapp/etc/modules/Zzyzzx_Store.xml
. Make sure you have<codePool>community</codePool>
and not<codepool>
as tag orlocal
as value.