Starmall_Shipment_Model
s
You should define your model under <global>
tag in config.xml
like
<global>
<models>
<starmall_shipment>
<class>Starmall_Shipment_Model</class>
<resourceModel>starmall_shipment_mysql4</resourceModel>
</starmall_shipment>
<starmall_shipment_mysql4>
<class>Starmall_Shipment_Model_Mysql4</class>
<entities>
<shipment>
<table>starmall_shipment</table>
</shipment>
</entities>
</starmall_shipment_mysql4>
</models>
</global>
because you are accessing if from outside the module.
Have a look how Magento cron works - it works as standalone script also (cron.php) and copy-paste code to your custom module. Main things:
require 'app/Mage.php';
...
Mage::getConfig()->init()
Also it seems like modules not loaded Try to add after init config:
Mage::getConfig()->loadModules();
It is prepending Mage because it is one of the core directories.. In my server, I see /var/www/app/code/core/Mage/ as a navigable path.
Put your standalone scripts in your mage base dir, and use the following code at the "beginning"
<?php
require_once 'app/Mage.php';
Mage::app('admin');
Hopefully this will be enough to get your magento up and running, then you can figure out why the paths aren't working the way you expect.
CarComp is write, after adding
Mage::app('admin');
the
Mage::getConfig()->init() working like a charm.
Why does it prepend Mage in front of the model? What can be wrong in my config?
To see, where this is happening, look at Mage_Core_Model_Config::getGroupedClassName()
:
if (empty($className)) {
if (!empty($config)) {
$className = $config->getClassName();
}
if (empty($className)) {
$className = 'mage_'.$group.'_'.$groupType;
}
if (!empty($class)) {
$className .= '_'.$class;
}
$className = uc_words($className);
}
This can mean one of two things:
$config
node was not found (global/models/starmall_shipment
)class
or model
child or it is emptyIn your case it looks like (1), so the question remains, why is your config not loaded. You assured that the config itself is correct, so the problem must be that the module is not loaded.
Can you post your module declaration file from app/etc/modules
?
Check whether compilation mode is enabled in your store(System->Tools->Compilation).If yes then re-run compilation process