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(); ?> ' ); // Product name if ( $productHyperLinks ) { if ( method_exists( $product, 'get_permalink' ) ) { echo wp_kses_post( ' ' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } else { echo wp_kses_post( '' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } } else { echo wp_kses_post( '' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } // SKU if ( $args['show_sku'] && is_object( $product ) && $product->get_sku() && $product ) { echo wp_kses_post( ' (#' . $product->get_sku() . ')' ); } if ( $args['show_des'] && is_object( $product ) && $product->get_short_description() && $product ) { echo wp_kses_post( '
(#' . $product->get_short_description() . ')
' ); } if ( $args['show_des'] && is_object( $product ) && 'variation' === $product->get_type() ) { echo wp_kses_post( '
(#' . $product->get_description() . ')
' ); } // allow other plugins to add additional product information here do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $args['plain_text'] ); // Display item meta data. wc_display_item_meta( $item ); echo ( '' ); // Show title/image etc if ( $args['show_image'] && is_object( $product ) ) { echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', '
' . esc_attr__( 'Product image', 'woocommerce' ) . '
', $item ) ); } } else { // Show title/image etc if ( $args['show_image'] && is_object( $product ) ) { echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', '
' . esc_attr__( 'Product image', 'woocommerce' ) . '
', $item ) ); } echo ( '
' ); // Product name if ( $productHyperLinks ) { if ( method_exists( $product, 'get_permalink' ) ) { echo wp_kses_post( ' ' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } else { echo wp_kses_post( '' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } } else { echo wp_kses_post( '' . wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ) . '' ); } // SKU if ( $args['show_sku'] && is_object( $product ) && $product->get_sku() && $product ) { echo wp_kses_post( ' (#' . $product->get_sku() . ')' ); } if ( $args['show_des'] && is_object( $product ) && $product->get_short_description() && $product ) { echo wp_kses_post( '
(#' . $product->get_short_description() . ')
' ); } if ( $args['show_des'] && is_object( $product ) && 'variation' === $product->get_type() ) { echo wp_kses_post( '
(#' . $product->get_description() . ')
' ); } // allow other plugins to add additional product information here do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $args['plain_text'] ); // Display item meta data. wc_display_item_meta( $item ); echo ( '
' ); } // Display item download links. if ( $args['show_download_links'] ) { wc_display_item_downloads( $item ); } // allow other plugins to add additional product information here do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $args['plain_text'] ); ?> get_item_subtotal( $item, false, true ), array( 'currency' => $order->get_currency() ) ) ); ?> get_quantity(), $item ) ); ?> get_data()['regular_price'] ) ? (float) $product->get_data()['regular_price'] : null; if ( (float) $product_regular_price !== $order->get_line_subtotal( $item ) ) { echo wp_kses_post( '' . wc_price( $product_regular_price ) . ' ' ); } } echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?> get_purchase_note() ) { $purchase_note = $product->get_purchase_note(); } if ( ( 'customer_on_hold_order' === $this->template || 'customer_processing_order' === $this->template || 'customer_completed_order' === $this->template || 'customer_refunded_order' === $this->template || 'customer_invoice' === $this->template || 'customer_note' === $this->template || 'new_order' === $this->template ) && isset( $args['show_purchase_note'] ) && is_object( $product ) && ! empty( $purchase_note ) ) { ?>