Add blank row solution xls issue after update
-
So I am working on a multi vendor site and one of our devs reached out a few months back for a solution to add a blank row after each new vendor for a product summary report for an xls file. The solution worked fine until the plugin was updated from V3.1.6 to V3.2.1 and for whatever reason the xls file now produces a empty file except for the column headers.
This was the solution offered by support which didn’t initially work.
add_action('woe_summary_before_output' , function() { $current_seller = false; $new_rows = array(); foreach($_SESSION['woe_summary_products'] as $data) { if($current_seller AND $current_seller!=$data['Sold By']){ $new_rows[]=array(); $current_seller=$data['Sold By']; } $new_rows[]=$data; } $_SESSION['woe_summary_products'] = $new_rows; });and here is the refactored version that did work.
add_action('woe_summary_before_output' , function() { $current_seller = false; foreach($_SESSION['woe_summary_products'] as $data) { if ($current_seller != $data['Sold By']){ $new_rows[]=array(); $current_seller=$data['Sold By']; } $new_rows[]=$data; } $_SESSION['woe_summary_products'] = $new_rows; });Any suggestions or potential solutions to add a blank row in the xls file with the current plugin version will be very helpful.
The topic ‘Add blank row solution xls issue after update’ is closed to new replies.