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 4542036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:19:54+00:00 2026-05-21T15:19:54+00:00

Possible Duplicate: Creating Hello world event dispatcher(observer) in Magento? Hi , In my Mage

  • 0

Possible Duplicate:
Creating Hello world event dispatcher(observer) in Magento?

Hi ,

In my Mage website i am in a situation to perform a set of tasks after a product being added to the shopping cart… i tried to create an event dispatcher, but not succeeded in it.

Can anyone give me info about step by step implementation of event dispatcher or any helpful link?

Thanks,

Balan

  • 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-21T15:19:55+00:00Added an answer on May 21, 2026 at 3:19 pm

    Step 1: define your module in /app/etc/module/Mycompany_Observer.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <config>
        <modules>
            <Mycompany_Observer>
                <active>true</active>
                <codePool>local</codePool>
                <depends>
                    <Mage_Core />
                </depends>
            </Mycompany_Observer>
        </modules>
    </config>
    

    Step 2: define your configuration in /app/code/local/Mycompany/Observer/etc/config.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <config>
        <modules>
            <Mycompany_Observer>
                <version>0.1.0</version>
            </Mycompany_Observer>
        </modules>
        <global>
            <models>
                <myobserver>
                    <class>Mycompany_Observer_Model</class>
                </myobserver>
            </models>
        </global>
        <frontend>
            <events>
                <add_to_cart_after>
                    <observers>
                        <my_unique_identifier>
                            <type>singleton</type>
                            <class>myobserver/observer</class>
                            <method>myAddToCartAfter</method>
                        </my_unique_identifier>
                    </observers>
                </add_to_cart_after>
            </events>
        </frontend>
    </config>
    

    Step 3: define your observer in /app/code/local/Mycompany/Observer/Model/Observer.php:

    class Mycompany_Observer_Model_Observer extends Mage_Core_Model_Abstract
    {
        public function myAddToCartAfter($oObserver)
        {
            var_dump($oObserver->getData());
            die('stop');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Creating ELF instead of a.out When I use the command gcc hello.cpp
Possible Duplicate: Creating makefile Hello, I am trying to create the makefiles and configure
Possible Duplicate: Creating or assigning variables from a dictionary in Python Hello we have
Possible Duplicate: Creating multiple numbers with certain number of bits set I'm attempting to
Possible Duplicate: Best way to stop SQL Injection in PHP I am creating a
Possible Duplicate: XNA Mouse Movement Basically, I am creating a game using XNA, and
Possible Duplicate: What is the 'new' keyword in JavaScript? creating objects from JS closure:
Possible Duplicate: New Cool Features of C# 4.0 Hello, There are several(many) questions at
Possible Duplicate: Creating a custom Document Library in SharePoint I have 2 users, Martin
Possible Duplicate: generating GUID without hyphen I am creating a GUID with the following

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.