display custom field without plugin in woocommerce

See I have a problem / I now want to display a custom field in a place where this field has several options that I tick if I see it in the product tab. If I do not show, do not display the following codes. Thank you.

The code below shows the field:

<?php $badges = get_field(‘badges_product’);
if( $badges && in_array(‘licensed’, $badges) ): ?><p>Test</p>

But despite this code does not display:

get_field(‘badges_product’);

If I put this code instead of the code above:

<?php global $product;

$units_sold = get_post_meta( $product->id, ‘badges_product’, true );
echo ”. sprintf( __( ‘%s’, ‘woocommerce’ ), $units_sold ).”; ?>

Now I’m going to put the third code in place of the second code, but I can not do anyone can help me out? Thanks

Read more here:: display custom field without plugin in woocommerce

Leave a Reply

Your email address will not be published. Required fields are marked *