Magento 2 - Get tax sum
-
15-04-2021 - |
해결책
Assuming you have the quote:
$totals = $quote->getTotals();
$tax = (isset($totals['tax'])) ? $totals['tax']->getValue(): 0;
If you do not have the quote you can inject \Magento\Checkout\Model\Session $checkoutSession to your constructor and get the quote using:
$quote = $checkoutSession->getQuote();
제휴하지 않습니다 magento.stackexchange