Domanda

Ho modulo personalizzato che è OneStepCheckout , nel senso che ho aggiunto 2 campi alla tabella esistente. Ma non è installato in core_resource e tables anche i campi non sono installati.

il mio codice è:

Magento \ app \ etc \ moduli \ Easylife_OnestepCheckout.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_OnestepCheckout>
            <active>true</active>
            <codePool>local</codePool>
        </Easylife_OnestepCheckout>
    </modules>
</config>

Magento \ app \ code \ locale \ Easylife \ OnestepCheckout \ etc \ config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Easylife_OnestepCheckout>
            <version>0.1.0</version>
        </Easylife_OnestepCheckout>
    </modules>

    <global>
        <models>
            <onestepcheckout>
                <class>Easylife_OnestepCheckout_Model</class>
            </onestepcheckout>
            <onestepcheckout_adminhtml>
                <class>Easylife_OnestepCheckout_Adminhtml_Model</class>
            </onestepcheckout_adminhtml>
        </models>
        <blocks>
            <checkout>
                <rewrite>
                    <links>Easylife_OnestepCheckout_Block_Links</links>
                </rewrite>
            </checkout>
            <onestepcheckout>
                <class>Easylife_OnestepCheckout_Block</class>
            </onestepcheckout>
        </blocks>
        <helpers>
            <checkout>
                <rewrite>
                    <url>Easylife_OnestepCheckout_Helper_Url</url>
                </rewrite>
            </checkout>
            <onestepcheckout>
                <class>Easylife_OnestepCheckout_Helper</class>
            </onestepcheckout>
        </helpers>
    </global>    
</config>

Magento \ app \ code \ locale \ Easylife \ OnestepCheckout \ sql \ onestepcheckout_setup \ install-0.1.0.php

<?php  

$installer = $this;
$installer->startSetup();

$installer->addAttribute(
    'sales_flat_order',
    'giftwrap',
    array(
        'type' => 'int',
        'grid' => false,
        'required' => false,
    )
);

$installer->addAttribute(
    'sales_flat_order',
    'giftwrap_price',
    array(
        'type' => 'decimal',
        'grid' => false,
        'required' => false,
    )
);

$installer->endSetup();

Posso sapere dove ho sbagliato?

Grazie.

È stato utile?

Soluzione

Nel vostro XML di configurazione non è presente definizione delle risorse in <global> nodo

   <resources>
        <onestepcheckout_setup>
            <setup>
                <module>Easylife_OnestepCheckout</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </onestepcheckout_setup>
    </resources>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top