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!
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();
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.
Re: How to get Shipping amount in cart Page magento 2 in your function use, $amount = $this->total->getShippingAmount();
$amount = $order->getGrandTotal() - $order->getShippingAmount();
Try not to over-think it. ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With