Not sure what I am doing wrong here.. but am trying to rewrite Magento core Catalog Product Model (app/code/Mage/Catalog/Model/Product) using custom module. See code below:
app/code/local/James/Catalog/etc/config.xml :
<?xml version="1.0"?>
<config>
<modules>
<James_Catalog>
<version>1.0.1</version>
</James_Catalog>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product>James_Catalog_Model_Product</product>
</rewrite>
</catalog>
</models>
</global>
</config>
app/code/local/James/Catalog/Model/Product.php :
<?php
require_once('Mage/Catalog/Model/Product.php');
class James_Catalog_Model_Product extends Mage_Catalog_Model_Product {
public function Test() {
return "Function Called";
}
}
app/etc/modules/James_Catalog.xml :
<?xml version="1.0"?>
<config>
<modules>
<James_Catalog>
<active>true</active>
<codePool>local</codePool>
</James_Catalog>
</modules>
</config>
Then, accessing the function :
$_product = Mage::getSingleton('catalog/product');
echo $_product->Test();
Nothing is returned. It doesn't look like I have access to the function. Ideas? Thanks for the help.