Created
September 19, 2012 04:49
-
-
Save gayanhewa/3747737 to your computer and use it in GitHub Desktop.
Magent extention : Working config.xml file with custom table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<modules> | |
<Sample_Socialmedia> | |
<version>0.0.1</version> | |
</Sample_Socialmedia> | |
</modules> | |
<frontend> | |
<routers> | |
<socailpromo> | |
<use>standard</use> | |
<args> | |
<module>Sample_Socialmedia</module> | |
<frontName>sharediscount</frontName> | |
</args> | |
</socailpromo> | |
</routers> | |
</frontend> | |
<global> | |
<models> | |
<socialmedia> | |
<class>Sample_Socialmedia_Model</class> | |
<resourceModel>socialmedia_mysql4</resourceModel> | |
</socialmedia> | |
<socialmedia_mysql4> | |
<class>Sample_Socialmedia_Model_Mysql4</class> | |
<entities> | |
<discount> | |
<table>sharediscount</table> | |
</discount> | |
</entities> | |
</socialmedia_mysql4> | |
</models> | |
<helpers> | |
<socialmedia> | |
<class>Sample_Socialmedia_Helper</class> | |
</socialmedia> | |
</helpers> | |
<events> | |
<sales_quote_collect_totals_after> | |
<observers> | |
<set_discount_static> | |
<type>singleton</type> | |
<class>Sample_Socialmedia_Model_Observer</class> | |
<method>setdiscountamount</method> | |
</set_discount_static> | |
</observers> | |
</sales_quote_collect_totals_after> | |
</events> | |
<resources> | |
<socialmedia_write> | |
<connection> | |
<use>core_write</use> | |
</connection> | |
</socialmedia_write> | |
<socialmedia_read> | |
<connection> | |
<use>core_read</use> | |
</connection> | |
</socialmedia_read> | |
<socialmedia_setup> | |
<setup> | |
<module>Sample_Socialmedia</module> | |
</setup> | |
<connection> | |
<use>core_setup</use> | |
</connection> | |
</socialmedia_setup> | |
</resources> | |
</global> | |
</config> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This config xml will look for a Model file named Discount in your Model directory and Make sure you have a resource files and collection added as well. The table name sharediscount.
PS: I just added this gist for my reference :) I tend to do mistakes in the config and break the damn thing !!!