Replies: 0
I created a custom field called Diameter and I want to display it only if it has value
I have the following in woocommerce / single-product / add-to-craft / variation.php:
<?php if ( !(empty(get_post_meta( $variation->get_id(), '_diameter', true )) ) ) : ?>
<div class="product-diameter">
{{{ data.variation.diameter }}}
</div>
<?php endif; ?>
I tried $variation->get_id() but that didn’t seem to work
How do I get the get field value of a variation?