I'm trying to implement the 2nd solution from philwinkle in this post: Price(float number) in transactional email
I have my folder setup like so: app/code/local/Anja/EmailModule/Model/Email/Template with the file Filter.php
The content of this file is:
class Anja_EmailModule_Model_Email_Template_Filter extends Mage_Core_Model_Email_Template_Filter
{
public function __construct()
{
parent::__construct();
$this->_modifiers['formatCurrency'] = array($this, 'modifierFormatCurrency');
}
public function modifierFormatCurrency($var)
{
return Mage::helper('core')->currency($var,false,false) . " Test";
}
}
but it doesn't appear to get processed at all by Magento. I have cleared cache and recompiled, but in the output not even the word Test gets displayed. What am I doing wrong? Do I also need an xml file somewhere?
Edit after some googling I find that I just want to extend the class. I have 2 xml files app/etc/modules/Anja_EmailModule.xml
<?xml version="1.0"?>
<config>
<modules>
<Anja_EmailModule>
<active>true</active>
<codePool>local</codePool>
</Anja_EmailModule>
</modules>
</config>
and in app/local/Anja/EmailModule/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Anja_EmailModule>
<version>0.1.0</version>
</Anja_EmailModule>
</modules>
<global>
<models>
<emailmodule>
<rewrite>
<email_template_filter>Anja_EmailModule_Model_Email_Template_Filter</email_template_filter>
</rewrite>
</emailmodule>
</models>
</global>
</config>
from this example: http://www.codexpedia.com/magento/how-to-extend-a-model-class-and-overrides-its-functions-in-magento/
I still don't see the word "Test" in my email.