with the help I received here yesterday, I'm trying to set up an observer that will update the "Manage Stock" option of all child items of a configurable product when it is changed. Following quite a few tutorials, I think I have the code right, but the observer isn't firing. My module is setup as follows:
The module setup in /app/etc/modules: MyCompany_Catalog.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyCompany_Catalog>
<active>true</active>
<codePool>local</codePool>
</MyCompany_Catalog>
</modules>
</config>
The config setup in /app/code/local/MyCompany/Catalog/etc: config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyCompany_Catalog>
<version>1.0.0</version>
</MyCompany_Catalog>
</modules>
<stores>
<admin>
<design>
<theme>
<template>MyCompany</template>
</theme>
</design>
</admin>
</stores>
<global>
<models>
<mycompany_catalog>
<class>MyCompany_Catalog_Model</class>
</mycompany_catalog>
</models>
<events>
<cataloginventory_stock_item_save_before>
<observers>
<mycompany_catalog>
<class>mycompany_catalog/observer</class>
<method>mc_update_child</method>
</mycompany_catalog>
</observers>
</cataloginventory_stock_item_save_before>
</events>
</global>
</config>
And finally, the observer in /app/code/local/MyCompany/Catalog/Model: Observer.php
<?php
class MyCompany_Catalog_Model_Observer
{
public function mc_update_child (Varien_Event_Observer $observer)
{
Mage::log('test');
}
}
The module is working as far as the design is concerned, as it is pulling in a custom 'inventory.phtml' that I created under /app/design/adminhtml/default/MyCompany/template/catalog/product/tab However, when I save a configurable parent, nothing is being written to the system.log (should be logging 'test'). I hope it's something silly, like I mistyped something or I'm calling the wrong observer, and an extra set of eyes can spot my mistake. TIA.