Line counter column in CSV (CSV EXPORT PLUGIN)
-
I currently use legacy one line per row for my exports but would like a column which acts as a counter for each line item.
For example if a user bought 2 items the column lets call it “lineitemincrement” would start at 1 and the be 2 for the second item and so fourth.I have tried the code below but I cant find the for loop that runs through the line items so I can use “$linecounter++”
function wccsvexportmodifyrowdata( $orderdata, $order, $csv_generator ) {
$customdata = array(
‘lineitem_increment’ => $linecounter
);
- The topic ‘Line counter column in CSV (CSV EXPORT PLUGIN)’ is closed to new replies.