Fix item_id notice
This commit is contained in:
parent
633299173d
commit
448337386f
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
foreach ( $items as $item ) :
|
||||
foreach ( $items as $item_id => $item ) :
|
||||
$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
|
||||
$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );
|
||||
?>
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
foreach ( $items as $item ) :
|
||||
foreach ( $items as $item_id => $item ) :
|
||||
$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
|
||||
$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );
|
||||
|
||||
|
@ -23,6 +23,9 @@ foreach ( $items as $item ) :
|
|||
echo ' (#' . $_product->get_sku() . ')';
|
||||
}
|
||||
|
||||
// allow other plugins to add additional product information here
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order );
|
||||
|
||||
// Variation
|
||||
echo $item_meta->meta ? "\n" . $item_meta->display( true, true ) : '';
|
||||
|
||||
|
@ -50,6 +53,9 @@ foreach ( $items as $item ) :
|
|||
}
|
||||
}
|
||||
|
||||
// allow other plugins to add additional product information here
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order );
|
||||
|
||||
// Note
|
||||
if ( $show_purchase_note && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) {
|
||||
echo "\n" . $purchase_note;
|
||||
|
|
Loading…
Reference in New Issue