Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get grand total without shipping costs from a Magento order model?

Tags:

magento

I have a Magento order model that I create like this:

$order = Mage::getModel('sales/order')->load($orderId);

Now I want to get the order grand total including the taxes etc., but without the shipping costs. I can retrieve the grand total with $order->getGrandTotal(), but how can I exclude the shipping costs?

Thank you in advance!

like image 249
Simon Avatar asked Nov 13 '11 21:11

Simon


People also ask

How to get grand total of cart Magento 2?

Get the number of items in cart and total quantity in cart. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); $totalItems = $cart->getQuote()->getItemsCount(); $totalQuantity = $cart->getQuote()->getItemsQty();

How can I remove shipping charges in Magento 2?

To disable any shipping method like flat rate: Goto Admin > Store > Configuration > Click on Shipping methods under Sales tab, it will show you all methods. Here you can disabled any method by setting "Enabled" option to No and click save config button.

How do I get shipping value from quote in Magento 2?

Re: How to get Shipping amount in cart Page magento 2 in your function use, $amount = $this->total->getShippingAmount();


1 Answers

$amount = $order->getGrandTotal() - $order->getShippingAmount();

Try not to over-think it. ;-)

like image 91
clockworkgeek Avatar answered Nov 16 '22 03:11

clockworkgeek