Ich versuche, neue Spalten hinzuzufügen, die ich brauche, in meinem moduloe, bascailly muss ich 3 Spalten zu der Tabelle "sales_flat_order" erstellen. Ich habe bereits das php-Skript erstellt, das sql hinzufügt und es auf meiner config.xml konfiguriert, aber nachdem ich meinen Laden geladen habe und meinen Cache geleert habe, ändert sich nichts, tut mir leid, wenn ich etwas vermisse, ist dies mein erstes Modul, das im Bau ist Neu beim Hinzufügen neuer Tabellen oder Spalten auf Magento.Neue Spalten für Tabelle erstellen
Meine Modulstruktur ist wie: - local/Company/Mynewmodule/SQL/invoicedocs_setup/mysql4-install-010.php
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('sales/order'),'magnifinance_invoice_id', array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'nullable' => true,
'length' => 10,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice ID'
))
->addColumn($installer->getTable('sales/order'),'magnifinance_invoice_url', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice URL Doc'
))
->addColumn($installer->getTable('sales/order'),'magnifinance_date', array(
'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,
'nullable' => true,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice Date'
));
$installer->endSetup();
- local/CompanyName/Mynewmodule/etc/config.xml:
<config>
<global>
<models>
<magnifinance>
<class>CompanyName_Mynewmodule_Model</class>
</magnifinance>
</models>
<resources>
<invoicedocs_setup>
<setup>
<module>CompanyName_Mynewmodule</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</invoicedocs_setup>
<invoicedocs_write>
<connection>
<use>core_write</use>
</connection>
</invoicedocs_write>
<invoicedocs_read>
<connection>
<use>core_read</use>
</connection>
</invoicedocs_read>
</resources>
...
bin ich etwas fehlt?
Obwohl Sie ** diese Frage hier stellen können, da es Code basiert .. Es ist besser gefragt, auf das Magento Board, wo Magento spezifische Probleme gestellt werden .. Sie könnten eine schnellere Antwort bekommen. Bis wann, hilft dieser Thread? -> https://magento.stackexchange.com/questions/65553/how-to-add-new-column-to-existing-table-in-magneto-programmatically – Zak