I've got a module with this rewrite in Magento 1.9.1.0 to change the checkout url in a nice way:
<blocks>
<checkout>
<rewrite>
<onepage_link>RD_ModuleName_Block_Onepage_Link</onepage_link>
</rewrite>
</checkout>
</blocks>
And this block:
<?php
class RD_ModuleName_Block_Onepage_Link extends Mage_Checkout_Block_Onepage_Link
{
public function getCheckoutUrl()
{
if($something === TRUE){
return $this->getUrl('someurl', array('_secure'=>true));
}
return parent::getCheckoutUrl();
}
}
This works perfectly. But I'd like to disable this module for one store so I've disabled it in the backend (configuration -> advanced). After this the complete checkout button is gone! Why? It looks like when there is a rewrite and the module output is disabled the rewrite stays but the block will not be rendered and it doesn't fallback to the original class (in this case Mage_Checkout_Block_Onepage_Link
).
I've done some research, my own getCheckoutUrl()
is never called but when I put a constructor in my class that one will be called. When I put some logging in the original Mage_Checkout_Block_Onepage_Link
class; no function there is called, when I put a constructor in it for testing, that one will be called.
Is this normal behavior of Magento or is it a bug? When it's normal, what other options do I have to accomplish the same in a nice way?