I am trying to override a core module on the Magento Platform.
This is absolutly no problem.
I’ve made a simple module for it and it’s loaded by default through the etc/modules/…xml file. But what I would like is to:
Call the module only on category pages.
Does anybody know if it is possible to call (define, set) a module from a template file?
How can I get it to load only on a particlar template file, or only on the category pages in that matter?
I am currently trying things out, but still cant wrap my fingers around the right code.
I think an if/else statement is right for the core module currency.php, but mayby you guys can help me out.
*This is what I was thinking, see the order not the code 😉 *
<?php
class MyCompany_ConstPrice_Model_Currency extends Mage_Directory_Model_Currency
{
public function __A_NAME_()
if(Mage::app()->getFrontController()->getRequest()->getRouteName() == 'catalog') :
elseif:
$this->_redirectReferer(Mage::getBase());
Rest of code....
?>
To provide an override you first need to rewrite the class alias.
Now you can do the actual override.
NB: I use
getCode()as the example because it’s the first function declared.