I need to get an order item tax percentage
<?php
namespace Company\Module\Plugin;
class myClass
{
protected $_orderRepository;
public function __construct(
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
) {
$this->_orderRepository = $orderRepository;
}
public function processOrder($orderId)
{
$order = $this->_orderRepository->get($orderId);
foreach ($order->getItems() as $item) {
var_dump($item->getTaxPercent());
}
}
}
I always get the value of 0.00 even though I know the percentage is 20.00.
Could anyone advise how I should get the tax percentage