Replies: 1
I’m trying to add a total billings column but I can’t get it to add correctly for each row of the spreadsheet since they are separate items
How do you access which is the current item that a row is accessing?
My current code is this:
add_filter( "woe_fetch_order", function($row, $order){
foreach( $order->get_items() as $order_item_id => $line ) {
$row["net_billings"] = $row['products'][$order_item_id]['qty'] *
$row['products'][$order_item_id]['item_price'] - $row['order_refund'];
}
return $row;
},10,2);