cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Shipping amount in cart Page magento 2

How to get Shipping amount in cart Page magento 2

I want a applied shipping amount in my custom page.

http://prntscr.com/iv862h

I want to get Applied Shipping amount for guest and logged In Customer.

Looking forward to your reply.

Thanks

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.
1 REPLY 1

Re: How to get Shipping amount in cart Page magento 2

public function __construct(
    \Magento\Quote\Model\Quote\Address\Total $total
) {
    $this->total = $total;
}

 

in your function use,
$amount = $this->total->getShippingAmount();

 

Clear Genereated folder and clear cache.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial