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

  • SEARCH
  • Home
  • 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 7073091
In Process

The Archive Base Latest Questions

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

When I need to rewrite a function in an observer located in the Enterprise

  • 0

When I need to rewrite a function in an observer located in the Enterprise section, how will that rewrite bit look like on config.xml.

is it something like this?

<global>
    <models>
        <enterprise>
            <rewrite>
                <giftcard>Custom_GiftCard_Model_Observer</giftcard>
            </rewrite>
        </enterprise>
    </models>
</global>

My class is declared as follow:
class Custom_GiftCard_Model_Observer extends Enterprise_GiftCard_Model_Observer {
…..
}

  • 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-28T05:53:16+00:00Added an answer on May 28, 2026 at 5:53 am

    I don’t have an enterprise development environment setup at the moment, so this is untested, but it should work as described.

    If you look at the Gift Card configuration in

    app/code/core/Enterprise/GiftCard/etc/config.xml
    

    You can grep about and discover the class alias for the gift card observer

    <class>enterprise_giftcard/observer</class>
    

    So, with a class alias of enterprise_giftcard/observer you have a model group name of enterprise_giftcard, and a model class name of observer.

    In your module’s configuration file, first you’ll create an area for model configuration

    <global>
        <models>
    
        </models>
    </global>
    

    Then, you’ll add the group name of the class you want to rewrite, enterprise_giftcard

    <global>
        <models>
            <enterprise_giftcard>
            </enterprise_giftcard>
        </models>
    </global>
    

    Then, you’ll add a node saying you want to rewrite the a single class in this group

    <global>
        <models>
            <enterprise_giftcard>
                <rewrite>
                </rewrite>
            </enterprise_giftcard>
        </models>
    </global>
    

    The, you’ll add a node indicating WHICH class in the group you wish to rewrite, using the name portion of the class alias (observer)

    <global>
        <models>
            <enterprise_giftcard>
                <rewrite>
                    <observer></observer>
                </rewrite>
            </enterprise_giftcard>
        </models>
    </global>
    

    And finally, within this node, you’ll add a text node that’s the name of your new class.

    <global>
        <models>
            <enterprise_giftcard>
                <rewrite>
                    <observer>Custom_GiftCard_Model_Observer</observer>
                </rewrite>
            </enterprise_giftcard>
        </models>
    </global>
    

    You can test your rewrite by instantiating the observer directly, and checking its class name

    $model = Mage::getModel('enterprise_giftcard/observer');
    var_dump(get_class($model));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm 'hacking' my router, and I need to rewrite one JS function that takes
I currently have a function that runs around 200 times. The function look like
Need a function that takes a character as a parameter and returns true if
I'm trying to invoke addEventListener() using apply() method. The code is like: function rewrite(old){
I need to implement simple function that is called from multiple threads. The logic
I have a javascript function (very big one!) that I need its functionality in
I need to rewrite some Perl code in python. So I'm looking for the
Here is a simplified version of the code I use. I need to rewrite
I need some help on mod rewrite 301 , to redirect my old website
I'm trying to use URL rewrite in my new project. But I also need

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.