I can't get an observer working, I'm using a fresh Magento install of 1.9.10.
My namespace: TM
My module: ProductConditions
app/etc/modules/TM_ProductConditions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<TM_ProductConditions>
<!-- Whether our module is active: true or false -->
<active>true</active>
<!-- Which code pool to use: core, community or local -->
<codePool>local</codePool>
</TM_ProductConditions>
</modules>
</config>
app/code/local/TM/ProductConditions/etc/config.xml:
<global>
<events>
<catalog_product_save_before>
<observers>
<ProductConditions>
<type>singleton</type>
<class>TM_ProductConditions_Model</class>
<method>catalog_product_save_before</method>
</ProductConditions>
</observers>
</catalog_product_save_before>
</events>
</global>
app/code/local/TM/ProductConditions/Model/Observer.php:
<?php
class TM_ProductConditions_Model_Observer
{
public function catalog_product_save_before($observer)
{
file_put_contents("C:\\mage test.txt", "test");
//$product = $observer->getProduct();
}
}