0

I have two packages installed in magento. First,Package1_Test1 second,Package2_Test2.
I have created one observer in Package1_Test1

path: community/Package1/Test1/etc/config.xml

<sales_convert_quote_item_to_order_item>
                <observers>
                    <package1_test1_identifier>
                        <type>model</type>
                        <class>package1_test1/observer</class>
                        <method>salesConvertQuoteItemToOrderItem</method>
                    </package1_test1_identifier>
                </observers>
</sales_convert_quote_item_to_order_item>

In Package2_Test2,I have created one observer

path: community/Package2/Test2/etc/config.xml

<sales_convert_quote_item_to_order_item>
                <observers>
                    <package2_test2_identifier>
                        <type>model</type>
                        <class>package2_test2/observer</class>
                        <method>salesConvertQuoteItemToOrderItem</method>
                    </package2_test2_identifier>
                </observers>
</sales_convert_quote_item_to_order_item>

It means that I have created same sales_convert_quote_item_to_order_item observer in both packages so my question is I want to run only second Package2_Test2 package observer rather then Package1_Test1.

Any dependency will work between two packages ?

Please help me,What I have to do ?

1 Answer 1

0

You can disable the observer on package1_test1 by placing code as below into package1_test2

Basically, you disable the observer in package1_test1

<events>
    <sales_convert_quote_item_to_order_item>
       <observers>
          <package1_test1_identifier>
              <type>disabled</type>
          </package1_test1_identifier>
       </observers>
    </sales_convert_quote_item_to_order_item>
</events>

If you want to use the code in package1_test1, you can simply extend (not rewrite) package1_test1 class from package1_test2, and then call it as a parent class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.