I have a setup. For products, I display prices with VAT (info added in the suffix). However, I must include a net price under this price (only in single-product-view). In addition, I have products that are without a price and with them using the Call For Price plugin to display a button to send a price inquiry.
I display the net price adding:
<?php echo woocommerce_price ($ product-> get_price_excluding_tax ()); ?>
added in the template /woocommerce/single-product/price.php
.
The problem is that in the case of a product without a price, I still see this value without tax (net) with the amount of 0.00. This one with VAT is deleted automatically.
I try also:
<?php if(woocommerce_price ($product-> get_price_excluding_tax ()) != '0.00') // If price is not equal to 0.00
{ echo woocommerce_price ($product-> get_price_excluding_tax ()); }
?>
and
<?php if( !empty(woocommerce_price ($product-> get_price_excluding_tax ()))) { echo woocommerce_price ($product-> get_price_excluding_tax ()); } ?>
Still 0,00 is visible.
How could I remove this net price in products that do not have the price indicated? Any ideas?