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

Adding post processing for orders? 
 
Sintax
Member
 
Total Posts:  58
Joined:  2008-02-18
Hungary
 

How would I add additional post processing for orders that have been completed? So when the user clicks the “Place Order” and the order gets written to the database I need to gather info from the order and fill values in another table.

How can this be done? I didn’t want to modify the core payment files so I am stuck on this…

Please Help,

Thanks,

::Sintax

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sintax
Member
 
Total Posts:  58
Joined:  2008-02-18
Hungary
 

What is the file that gets executed upon the Place Order button?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michae1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Hi Sintax,

We have a number of different events raised on each operation. You can check the code to find on which ones you want to create your own observers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sintax
Member
 
Total Posts:  58
Joined:  2008-02-18
Hungary
 

Hi,

How do I create an observer for the “successful order”? Since I need to add additional data to the database with the order’s and user’s ID along with awarded points. Currently the way I do it is by adding it to the success.phtml and getting the last order’s info. Hower it is NOT guaranteed that the order will not be canceled (in which case I would need to rollback the awards, which I can’t). So I need something that can hookup to the observers and get executed once the order is fulfilled => when it no longer can be cancelled.

Here is the code I use in sucess.phtml:

$_customerId Mage::getSingleton('customer/session')->getCustomerId();
$lastOrderId Mage::getSingleton('checkout/session')->getLastOrderId();
$order Mage::getSingleton('sales/order');
$order->load($lastOrderId);

$_totalData =$order->getData();

$_grand $_totalData['grand_total'];
$_sub $_totalData['subtotal'];
$_ship $_totalData['shipping_amount'];
$_discount $_totalData['discount_amount'];


$_total $_sub $_discount;

$_awards floor($_total $convertrate);

This however does not ensure that the order does not get cancelled.

How is this done the Magento way?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lance Monotone
Member
 
Avatar
Total Posts:  63
Joined:  2008-04-16
North Adams, MA. 01247
 

You gotta love the timely responses from the Team. 

Well anyway, thank you, Sintax, for answering my question on how to bring the order total to the Success page. I think it should be easier than that.  It would be nice if the order info was still available to be used without all the runaround.

I don’t know if you ever figured your problem out, but you might try this post: http://www.magentocommerce.com/boards/viewthread/3459/.  I haven’t tried this myself so I don’t know if it’s up to the usual Magento standards of helpfulness.

Since you seem to be more hooked into Magento than I am at the moment, maybe you could help me with this post? http://www.magentocommerce.com/boards/viewthread/10762/

Thanks!

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