I am trying to get the shipping price from the quote on the cart page for the entire order.

I have tried multiple things including:


$rates = Mage::getModel("checkout/session")->getQuote()->getShippingAddress()->getAllShippingRates();
foreach($rates as $rate){

What can I do to get the shipping price in the Magento cart?

1 Answer 1


This will do the trick. From your question, I assume that the customer has already selected their desired shipping method.


$quote = Mage::getModel("checkout/session")->getQuote();
$amount = $quote->getShippingAddress()->getShippingAmount();

In fact, there are a number of methods available to you. Such as:


$address = $quote->getShippingAddress();


If you simply want to get all available shipping rates into an array:


$address = $quote->getShippingAddress();

$shippingPrices = array();
foreach($address->getAllShippingRates() as $rate){
    $shippingPrices[$rate->getCode()] = $rate->getPrice();
  • 1
    My pleasure and good luck to you in your endeavors! Commented Aug 18, 2016 at 17:48
  • Thanks it worked Commented Jul 3 at 8:46

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.