I am following a tutorial from the book of Roman Zenner & Vinai Kopp called "Magento - The Handbook for Developers" (german: Magento - Das Handbuch für Entwickler).
Snippet from config.xml
<config>
<modules>
<WR_EPO>
<version>1.0.0.12</version>
</WR_EPO>
</modules>
<global>
<resources>
<wr_epo_setup>
<setup>
<module>WR_EPO</module>
</setup>
</wr_epo_setup>
...
It says that I need this setup script: The script is in (app/code/local/WR/EPO/sql/wr_epo_setup/upgrade-1.0.0.11-1.0.0.12):
<?php
/**
* @var Mage_Sales_Model_Mysql4_Setup $installer
*/
$installer = $this;
$installer->startSetup();
Mage::Log("Setup Script is getting executed.", 7, "setup.log");
$installer->addAttribute('quote_item', 'shipping_surcharge', array(
'label' => 'Versandkostenaufpreis'
,'type' => 'decimal'
)
);
$installer->endSetup();
But I get a 500 Status Code Error and the error Call to undefined method Mage_Core_Model_Resource_Setup::addAttribute()
is getting logged.
I also tried this:
Snippet from config.xml
<config>
<modules>
<WR_EPO>
<version>1.0.0.12</version>
</WR_EPO>
</modules>
<global>
<resources>
<wr_epo_setup>
<setup>
<module>WR_EPO</module>
</setup>
</wr_epo_setup>
<wr_epo_sales_setup>
<setup>
<module>WR_EPO</module>
<class>Mage_Sales_Model_Mysql4_Setup</class>
</setup>
</wr_epo_sales_setup>
...
... and moved the setup script from app/code/local/WR/EPO/sql/wr_epo_setup/upgrade-1.0.0.11-1.0.0.12
to app/code/local/WR/EPO/sql/wr_epo_sales_setup/upgrade-1.0.0.11-1.0.0.12
but now the setup script is not getting executed at all, I already removed the entry in the core_resources table and reloaded the site.
Is the tutorial outdated? How to do it right?