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 {
…..
}
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
You can grep about and discover the class alias for the gift card observer
So, with a class alias of
enterprise_giftcard/observeryou have a model group name ofenterprise_giftcard, and a model class name ofobserver.In your module’s configuration file, first you’ll create an area for model configuration
Then, you’ll add the group name of the class you want to rewrite,
enterprise_giftcardThen, you’ll add a node saying you want to rewrite the a single class in this group
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)And finally, within this node, you’ll add a text node that’s the name of your new class.
You can test your rewrite by instantiating the observer directly, and checking its class name