I'm trying to get the regular product price with tax included but I cannot find any WooCommerce function or variable with this purpose.
To get the regular product price without tax I'm using:
$price = $product->get_regular_price();
But how can I get the regular product price WITH tax included?
wc_get_price_including_tax( $product, array('price' => $price ) );
wc_get_price_including_tax( $product, array('price' => $specialPrice ) );
LE: You need to add the price as the second argument to wc_get_price_including_tax()
Here is the code -
product price with tax - wc_get_price_including_tax($product);
product price without tax - wc_get_price_excluding_tax($product);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With