Skip to content

Commit 9756932

Browse files
authored
Merge pull request #194 from TycheSoftwares/issue-162
issue-162
2 parents 43210c8 + aa75c4b commit 9756932

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

woocommerce-delivery-notes/templates/print-order/print-content.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
</span>
140140

141141
<?php
142+
$item_meta_fields = apply_filters( 'wcdn_product_meta_data', $item['item_meta'], $item );
142143

143144
$product_addons = array();
144145
$woocommerce_product_addon = 'woocommerce-product-addons/woocommerce-product-addons.php';
@@ -149,7 +150,7 @@
149150
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
150151
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
151152
$variation = wc_get_product( $item['product_id'] );
152-
foreach ( $item['item_meta'] as $key => $value ) {
153+
foreach ( $item_meta_fields as $key => $value ) {
153154
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
154155
if ( is_array( $value ) ) {
155156
continue;
@@ -173,7 +174,7 @@
173174
}
174175
}
175176
} else {
176-
foreach ( $item['item_meta'] as $key => $value ) {
177+
foreach ( $item_meta_fields as $key => $value ) {
177178
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
178179
if ( is_array( $value ) ) {
179180
continue;
@@ -192,7 +193,7 @@
192193
}
193194
}
194195
} else {
195-
$item_meta_new = new WC_Order_Item_Meta( $item['item_meta'], $product );
196+
$item_meta_new = new WC_Order_Item_Meta( $item_meta_fields, $product );
196197
$item_meta_new->display();
197198

198199
}

0 commit comments

Comments
 (0)