1

I'm trying to add some functionaltiy after generating invoice by magento store owner for orders. I'm using the following code

<sales_order_invoice_save_after> 
    <observers>
        <sales_order_invoice_save_after_handler> 
            <type>model</type> 
            <class>invoice/observer</class>
            <method>saveinvoiceno</method>  
        </sales_order_invoice_save_after_handler>
    </observers>
</sales_order_invoice_save_after>

Issue

Above code is also working PayPal payment, but i want to execute it for admin only. Any suggestion or help?

Thank you in advance.

  • Can you please give some feedback? Did it answer your question? – sv3n Jul 2 '17 at 8:29
  • issue is not resolved yet. – Ashvini Marwal Jul 3 '17 at 5:19
1

If it should be for admin only, you have to put it inside adminhtml node:

<?xml version="1.0"?>
<config>
    <modules>
        ...
    </modules>
    <global>
        ...
    </global>
    <adminhtml>
        <events>
            <sales_order_invoice_save_after> 
                <observers>
                    <sales_order_invoice_save_after_handler> 
                        <type>model</type> 
                        <class>invoice/observer</class>
                        <method>saveinvoiceno</method>  
                    </sales_order_invoice_save_after_handler>
                </observers>
            </sales_order_invoice_save_after>
        </events>
    </adminhtml>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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