You need to change your way to get product attributes in phtml:
you can get attributes using getAttr($_item->getProductId()); ?><?php $attributes = $block->getAttr($_item->getProductId()); ?>
and after that you need to change function defined in block as:
public function getAttr($id) {
public function getAttr($id)
{
$product = $this->productFactory->create()->load($id);
return $product;
}
}
Now you can get all attributes in below way:
echo $attributes->getName();
echo $attributes->getPrice();
echo $attributes->getName();
echo $attributes->getPrice();
In this way you can get any other custom attribute's value. In this way you can get any other custom attribute's value.Hope this was helpful.