Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom table in magento is not created after adding all the code

Tags:

xml

magento

Here is the code of my config.xml file for my module. Take a look at the code and suggest me where I am wrong. I am new to magento and does not know much about the declarations used in the config file. Any help will be appreciated.

<?xml version="1.0"?>
<config>
    <global>
        <models>
            <xyz_xyzshipping>
                <class>Xyz_Xyzshipping_Model</class>
                <resourceModel>xyz_xyzshipping_resource</resourceModel>
            </xyz_xyzshipping>
            <xyz_xyzshipping_resource>
                <class>Xyz_xyzshipping_Model_Resource</class>
                <entities>
                    <custom>
                        <table>xyz_xyzshipping_custom</table>
                    </custom>
                </entities>
            </xyz_xyzshipping_resource>            
        </models>
        <resources>
                <xyz_xyzshipping_setup>
                        <setup>
                                <module>Xyz_Xyzshipping</module>
                        </setup>                                
                </xyz_xyzshipping_setup>
        </resources>
        <blocks>
                <xyz_xyzshipping>
                        <class>Xyz_Xyzshipping_Block</class>
                </xyz_xyzshipping>
        </blocks>
        <helpers>
            <xyz_xyzshipping>
                <class>Xyz_Xyzshipping_Helper</class>
            </xyz_xyzshipping>
        </helpers>

    </global>


    <default>
        <carriers>
            <xyz_xyzshipping>
                <active>1</active>
                <sort_order>10</sort_order>
                <model>xyz_xyzshipping/carrier</model>
                <title>Xyz Shipping</title>
                <sort_order>10</sort_order>

            </xyz_xyzshipping>
        </carriers>
    </default>
</config>
like image 232
Mani Avatar asked Jul 27 '15 14:07

Mani


1 Answers

You need to use installer script that consists sql code.

You can refer following link

http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/

This is tutorial for creating basic extension with custom table.

like image 102
Emipro Technologies Pvt. Ltd. Avatar answered Oct 24 '22 03:10

Emipro Technologies Pvt. Ltd.