Get refunded orders and refunded order items details in Woocommerce 3

前端 未结 2 983
心在旅途
心在旅途 2020-12-07 02:54

I see when I look at an order it will show the specific item that was refunded if the whole order wasn\'t.

Is there a way to find using the WC_Order_Item_Prod

2条回答
  •  独厮守ぢ
    2020-12-07 03:03

    If you are using get_qty_refunded_for_item( $item_id ) or get_total_refunded_for_item( $item_id ) returns 0 use absint().

    $item_qty_refunded = $order->get_qty_refunded_for_item( $item_id ); // Get the refunded amount for a line item.
    
    $item_total_refunded = $order->get_total_refunded_for_item( $item_id ); // Get the refunded amount for a line item.
    

提交回复
热议问题