2

This is code i use for getting current session shipping method code:

<?PHP echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod(); ?>

But this code is only giving me the current session shipping method code not the shipping title.

How can i get the current session shipping method title ?

4
  • This is close to what you are looking for stackoverflow.com/questions/6032936/…
    – Rabea
    Sep 28, 2015 at 16:47
  • Can you post the exact code that you think i must use as your answer to this question ? Sep 28, 2015 at 16:49
  • <?php echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingDescription(); ?> Sep 28, 2015 at 16:51
  • not working.... Sep 28, 2015 at 16:52

1 Answer 1

2

If the shipping method is estimated on the cart page or checkout page, you should be able to get the title of the shipping method with: Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingDescription(); Please keep in mind that this will return an empty string if it wasn't chosen on the cart page or checkout.

I added the title on top of the cart. in app/design/frontend/rwd/default/template/checkout/cart.phtml

echo "<pre>" . Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingDescription() . "</pre><br />";

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.