get_id(); $terms = wp_get_post_terms( $product_id, $name, 'all' ); if ( ! empty( $terms ) ) { if ( ! is_wp_error( $terms ) ) { $tax = $terms[0]->taxonomy; $tax_object = get_taxonomy( $tax ); if ( isset( $tax_object->labels->singular_name ) ) { $out['label'] = $tax_object->labels->singular_name; } elseif ( isset( $tax_object->label ) ) { $out['label'] = $tax_object->label; $label_prefix = __( 'Product', 'woocommerce-show-attributes' ) . ' '; if ( 0 === strpos( $out['label'], $label_prefix ) ) { $out['label'] = substr( $out['label'], strlen( $label_prefix ) ); } } $tax_terms = array(); foreach ( $terms as $term ) { $single_term = esc_html( $term->name ); // Show terms as links? if ( $single_product ) { if ( get_option( 'wcsa_terms_as_links' ) == 'yes' ) { $term_link = get_term_link( $term ); if ( ! is_wp_error( $term_link ) ) { $single_term = '' . esc_html( $term->name ) . ''; } } } array_push( $tax_terms, $single_term ); } $out['value'] = implode( ', ', $tax_terms ); } } return $out; } endif; foreach ( $items as $item_id => $item ) : if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { $product = $item->get_product(); $result_attributes = array(); ?>