Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Setting a oberser to an admin event
 
hekier
Jr. Member
 
Total Posts:  8
Joined:  2008-04-25
Denmark, Smorum
 

Hi all

I’m trying to find a way to add some data to an order, and then saving them to a database when order is created…

I have got it to work in the frontend with a eventlistener/observer listen to the event - event listener in frontend is set in config.xml like this

<frontend>
        <
events>
            <
sales_convert_quote_to_order>
                <
observers>
                    <
deleverydate>
                        <
type>model</type>
                        <class>
deleverydate/observer</class>
                        <
method>salesEventConvertQuoteToOrder</method>
                    </
deleverydate>
                </
observers>
            </
sales_convert_quote_to_order>
            <
checkout_controller_onepage_save_shipping_method>
                <
observers>
                    <
deleverydate>
                        <
type>model</type>
                        <class>
deleverydate/observer</class>
                        <
method>checkoutEventCreateDeleveryDate</method>
                    </
deleverydate>
                </
observers>
            </
checkout_controller_onepage_save_shipping_method>
        </
events>
    </
frontend>

And I have tried the following for backend (create order event)

<adminhtml>
        <
events>
            <
sales_convert_quote_to_order>
                <
observers>
                    <
deleverydate>
                        <
type>model</type>
                        <class>
deleverydate/observer</class>
                        <
method>salesEventConvertQuoteToOrder</method>
                    </
deleverydate>
                </
observers>
            </
sales_convert_quote_to_order>
            <
adminhtml_sales_order_create_create_order>
                <
observers>
                    <
deleverydate>
                        <
type>model</type>
                        <class>
deleverydate/observer</class>
                        <
method>checkoutEventCreateOrder</method>
                    </
deleverydate>
                </
observers>
            </
adminhtml_sales_order_create_create_order>
            <
sales_convert_order_to_quote>
                <
observers>
                    <
deleverydate>
                        <
type>model</type>
                        <class>
deleverydate/observer</class>
                        <
method>salesEventOrderToQuote</method>
                    </
deleverydate>
                 </
observers>
            </
sales_convert_order_to_quote>
        </
events>
    </
adminhtml>

Am I one the correct way or should I do something else…

Hope someone can help

 
Magento Community Magento Community
Magento Community
Magento Community
 
hekier
Jr. Member
 
Total Posts:  8
Joined:  2008-04-25
Denmark, Smorum
 

None ane appel to help???

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top