diff --git a/includes/class-wc-order-item-meta.php b/includes/class-wc-order-item-meta.php index 7da103617c4..994bb06ba1b 100644 --- a/includes/class-wc-order-item-meta.php +++ b/includes/class-wc-order-item-meta.php @@ -139,7 +139,15 @@ class WC_Order_Item_Meta { } } - $formatted_meta[ $meta_key ] = array( + // Unique key required + $formatted_meta_key = $meta_key; + $loop = 0; + while ( isset( $formatted_meta[ $formatted_meta_key ] ) ) { + $loop ++; + $formatted_meta_key = $meta_key . '-' . $loop; + } + + $formatted_meta[ $formatted_meta_key ] = array( 'label' => wc_attribute_label( $attribute_key ), 'value' => apply_filters( 'woocommerce_order_item_display_meta_value', $meta_value ), );