Skip to content

Commit 3f7031f

Browse files
committed
Update Orders_Controller.php
1 parent 1005178 commit 3f7031f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

includes/API/Orders_Controller.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ public function maybe_set_item_meta_data( $item, $posted ) {
341341
*/
342342
parent::maybe_set_item_meta_data( $item, $posted );
343343

344+
// Ensure this is a product line item, not a fee or shipping
345+
if ( ! $item instanceof WC_Order_Item_Product ) {
346+
return;
347+
}
348+
349+
// Only proceed if there's a variation ID and we have posted meta
344350
if ( ! $item->get_variation_id() || empty( $posted['meta_data'] ) || ! is_array( $posted['meta_data'] ) ) {
345351
return;
346352
}

0 commit comments

Comments
 (0)