Skip to content

Instantly share code, notes, and snippets.

@pauldowlin
Created January 19, 2018 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauldowlin/ffbff08be311e1c5fc52ec02891f71e4 to your computer and use it in GitHub Desktop.
Save pauldowlin/ffbff08be311e1c5fc52ec02891f71e4 to your computer and use it in GitHub Desktop.
add_action( 'woocommerce_order_item_meta_end', 'custom_woocommerce_order_item_meta_end', 10, 3 );
function custom_woocommerce_order_item_meta_end( $item_id, $item, $order ) {
$product = $item->get_product();
$locations = get_the_terms( $product->get_id(), 'my_custom_taxonomy' );
echo '<br/>';
echo '<div style="margin-top: 20px;">';
foreach( $locations as $location ) {
echo 'Location: <b>' . $location->name . '</b>';
echo '<br/>';
}
echo '</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment