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?


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! – Shawn Abramson Aug 18 '16 at 17:48

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.