I am developing a custom module for Magento (CE, 1.9) and I'm running into the most basic problem, my models (which should override core models) are not being found/loaded correctly. I have diagnosed this back to Mage.php and can see where it is adding, for example the singleton catalog/layer, and instead of adding the object it only gets a boolean. This causes all subsequent code to fail of course.
I have checked my configuration against this module creator and my directories and code all match exactly what is produced, so I'm at a loss!
etc/modules/Namespace_Pricing.xml
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Pricing>
<active>true</active>
<codePool>community</codePool>
<version>0.1.0</version>
</Namespace_Pricing>
</modules>
</config>
app/code/community/Namespace/Pricing/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Pricing>
<version>1.0</version>
</Namespace_Pricing>
</modules>
<global>
<helpers>
<pricing>
<class>Namespace_Pricing_Helper</class>
</pricing>
</helpers>
<models>
<pricing>
<class>Namespace_Pricing_Model</class>
</pricing>
<catalog>
<rewrite>
<product_type_price>Namespace_Pricing_Model_Catalog_Product_Type_Price</product_type_price>
</rewrite>
</catalog>
<catalog>
<rewrite>
<layer>Namespace_Pricing_Model_Catalog_Layer</layer>
</rewrite>
</catalog>-->
</models>
</global>
</config>
app/code/community/Namespace/Pricing/Model/Catalog/Layer.php
<?php
class Namespace_Pricing_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
{
}
app/code/community/Namespace/Pricing/Model/Catalog/Product/Type/Price.php
<?php
class Namespace_Pricing_Model_Catalog_Product_Type_Price extends Mage_Catalog_Model_Product_Type_Price
{
}
Namespace
is not literal, but it's just a string and is correctly cased everywhere used. What else do I need to look at outside these directories? With the module active, in fact just with the rewrites in place in config.xml
, Magento throws an exception that the model (catalog/layer etc) already exists in the registry, because it only exists as a boolean False when set.