How to get current cart subtotal and grand total price in magento2

How to get current cart subtotal and grand total price in magento2:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$cartObj = $objectManager->get('\Magento\Checkout\Model\Cart');

$subTotal = $cartObj->getQuote()->getSubtotal(); //Current Cart Subtotal

$grandTotal = $cartObj->getQuote()->getGrandTotal(); //Cart Grand total

 

CORNER OF BLOG:

“Don’t Waste Water to Taste it Later.”

Leave a Reply