6

Hi can anybody tell me how can i get after successfully order is placed shipping method title?

Here is what i have

$iOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$oOrder = Mage::getModel('sales/order')->loadByIncrementId($iOrderId);

echo $oOrder->getShippingMethod();

but how can i get this shipping method title?

4 Answers 4

21
$oOrder->getShippingDescription();
3
$order = Mage::getModel('sales/order')->loadByIncrementId($iOrderId);
$order->getShippingDescription();

Or

$shipping = $order->getShippingAddress()->getShippingMethod();
echo $shipping->getData('title');
1
  • 7
    gettype($order->getShippingAddress()->getShippingMethod()) returns null Jun 25, 2015 at 15:41
1

This worked for me when looking for the custom title:

Mage::getModel('sales/order')->loadByIncrementId($orderId)->getTracksCollection()->getFirstItem()->getTitle();
1
$order->getShippingDescription(); // returns Shipping Method Title
4
  • For checkout page what event need to use, check what are all the shipping methods available before place an order. @Nitesh
    – Gem
    Aug 13, 2019 at 8:02
  • @Gem Please try with this event "checkout_cart_save_after" and let me know is it worked? Aug 13, 2019 at 8:26
  • Here is my observer -> log testing not generated, paiza.io/projects/94Pe8vp1jgdXXepLxUDzfQ could you pls help me.
    – Gem
    Aug 13, 2019 at 9:12
  • @Gem ohhh its magento 1, I am sorry for that I don't know about it Aug 14, 2019 at 6:18

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.