The default Magento 2 displays the original product price as configured from the admin panel. It does not include the tax amount that a customer has to pay.
It may happen that a customer might feel deceived to find out the tax amount only after going through the selection process and when adding the product to the cart.
Also, when you are offering your Magento 2 store products on a third-party platform/marketplace, say, Facebook store, the original product price is displayed.
Now, if you want to display the price including the tax, you need to programmatically fetch the product price with tax amount added.
Here’s the solution to get product price including tax in Magento 2.
Solution to Get Product Price Including Tax in Magento 2:
use Magento\Catalog\Helper\Data as TaxHelper;
class Data extends AbstractHelper
public function __construct(
$this->productModel = $productModel;
$this->taxHelper = $taxHelper;
public function getProductPrice($productId)
$product = $this->productModel->load($productId);
$price = $this->taxHelper->getTaxPrice($product, $product->getFinalPrice(), true);
Any doubts about the programmatic method to get product price including tax in Magento 2 can be mentioned in the Comments section below.
I’d be happy to help.
Also, do share the solution with Magento Community via social media.
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.