Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DaWebmaster

    (@dawebmaster)

    I found this:

    <?php
    if ( !empty($item[‘product’]) && $location = get_post_meta( $item[‘product’]->id, ‘Location’, true ) ) {
    echo ‘<div class=”product-location”>Location: ‘.$location.'</div>’;
    }
    ?>

    But when I replaced $location with my meta which is order_card_message it doesn’t work. What am I doing wrong?

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! The code snippet you found looks like it is supposed to show a custom field from the product rather than from the checkout.

    If you need a field from the checkout like you wrote in your initial post, check out the documentation here:
    Displaying a custom field

    Or if you need to display a custom field from the product like that snippet (looks like this may be where you got that?):
    Displaying product custom fields

    Hope that helps!
    Ewout

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add in meta information’ is closed to new replies.