Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:45:16+00:00 2026-05-28T16:45:16+00:00

I read a lot of documentation about custom module creation for Magento. For my

  • 0

I read a lot of documentation about custom module creation for Magento.

For my fist try, i created the module structure using Module Creator, and this is the code i added in /app/code/local/Test/MyModule/etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Test_MyModule>
            <version>0.1.0</version>
        </Test_MyModule>
    </modules>
    <!-- frontend, admin, adminhtml -->
    <global>
        <!-- models, resources, blocks, helpers -->
        <events>
          <sales_order_place_before> <!-- event i need to catch -->
            <observers>
              <trigger_mymodule_placeorder> 
                <type>model</type>
                <class>test/mymodule/model_observer</class>
                <method>sendOrder</method>
              </trigger_mymodule_placeorder>
            </observers>
          </sales_order_place_before>
        </events>
    </global>
</config> 

My /app/etc/modules/Test_MyModule.xml file:

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

And this is my /app/code/local/Test/MyModule/Model/Observer.php:

<?php
class Test_MyModule_Model_Observer
{
    public function sendOrder()
    {
        // do something.
    }
}

.. but the Test_MyModule_Model_Observer::sendOrder() function is never triggered (i tryed putting inside it a dummy database logger to see if/when the function get executed).

I know the module itself is loaded correctly becose, in the module’s config.xml, it declare a new link in main menu and the link get displayed correctly (after flushing magento’s cache), so i guess the problem is the function naming convention that I am missing somewhere.. but where?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:45:17+00:00Added an answer on May 28, 2026 at 4:45 pm

    You have two issues that I can see, which are both related. You are specifying the class to use using the syntax that Mage::getModel accepts, but you are a.) slightly wrong in the syntax, b.) seemingly not actually declaring where you models are contained (unless you took it out in order to be more concise).

    You need to add your models into the global node.

    <models>
       <testmodule>
           <class>Test_MyModule_Model</class>
       </testmodule>
    <models>
    

    The testmodule part can be anything you like so long as it’s unique for your module. The class value used in the observer part will then become…

    <class>testmodule/observer</class>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read a lot of documentation about this before i decided to ask. So
I've read through a lot of the documentation and for some reason this still
I've read a lot of documentation about FQL (awesome!) and finally I've found two
I know that there has to be quite a lot of documentation about this
I've read all the documentation about hooks , similar questions and a lot of
I like a lot of what I've read about D. Unified Documentation (That would
I read a lot of documentation about Clojure (and shall need to read it
I read the Sun documentation and a lot of posts on Stack Overflow, but
I got question about log4net is it working on IIS 7,5? I read lot
I've read a lot of conflicting information about whether or not URLForUbiquityContainerIdentifier: should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.