1

What i am trying I want After Add product to Order from admin i want to trigger my action . I tried with below event but its not working for me can you please let me what event i have to use

  • sales_order_place_before
  • adminhtml_sales_order_create_process_data
  • sales_order_save_after

config.xml

<config>
    <modules>
        <NameSpace_AdditionalProduct>
            <version>0.1.0</version>
        </NameSpace_AdditionalProduct>
    </modules>
    <global>
        <helpers>
            <additionalproduct>
                <class>NameSpace_AdditionalProduct_Helper</class>
            </additionalproduct>
        </helpers>
        <models>
            <additionalproduct>
                <class>NameSpace__AdditionalProduct_Model</class>
                <resourceModel>additionalproduct_mysql4</resourceModel>
            </additionalproduct>
        </models>
    </global>
    <adminhtml>
        <events>
            <sales_order_place_after>
                <observers>
                    <custom_promopack_order_observer>
                        <type>singleton</type>
                        <class>additionalproduct/observer</class>
                        <method>addPromoPack</method>
                    </custom_promopack_order_observer>
                </observers>
            </sales_order_place_after>
        </events>
    </adminhtml>
</config>

observer.php

public function addPromoPack(Varien_Event_Observer $observer)
{
    Mage::log("================================hello========================");
    die('heeeeeeeeeeeeeeel');
}
7
  • use Mage::log('test') instead of echo and die.
    – Sohel Rana
    Jun 20, 2017 at 4:54
  • @sohel : tried still not working Jun 20, 2017 at 5:00
  • Share how you register model in global scope.
    – Sohel Rana
    Jun 20, 2017 at 6:08
  • 1
    Your observer function name should be addPromoPack instead of productlevelChanges Jun 20, 2017 at 6:46
  • 1
    Double underscores in class name isn't correct too.
    – sv3n
    Jun 20, 2017 at 6:50

2 Answers 2

2

You can try these:

  • sales_quote_item_set_product
  • sales_quote_add_item
  • sales_quote_product_add_after
1
  • this event worked sales_quote_item_set_product Jun 20, 2017 at 7:32
0

Please try following event

sales_model_service_quote_submit_after

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.