Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Create new billings column

$
0
0

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);

Viewing all articles
Browse latest Browse all 59525

Trending Articles