Check if Product is Virtual

Simple function to check is WooCommerce Product is virtual. Can be used in the Cart or on Product page.

<?php if ($product-> is_virtual('yes')) { ?>
	<p><strong>Digital product: Be advised that digital products cannot be returned, refunded, or exchanged.</strong></p>
<?php } ?>


Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.