I have the following situation:

I am on the checkout page, and i have 3 Shipping methods. If i select a specific method form all 3 and i finish the order, i want a comment to be added automatically on the orders view from backend in this area:

enter image description here

Does anyone have any idea how can i do this?

| improve this question | | | | |

You'll want to create an event-observer module & observe sales_order_place_after.

Your observer method would look like this:

public function logShipping($observer){
    $order = $observer->getEvent()->getOrder();
    $history = $order->addStatusHistoryComment($order->getShippingMethod(), false);
| improve this answer | | | | |

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.