Export all orders and add simpler counter to orders

Hello! I’ve noticed that there is no longer a mass order export function; it used to be you could export everything to a CSV. My question is whether there is still a function or method for exporting all the order data to CSV, and I have a related question about inserting a kind of counter function to the packing slips. Here is some background info:

For the past two years, with some coding tweaks, I would use the exported CSV to generate packing slips for customer pickup. Since the store has complicated, non-sequential order IDs (such as “25c6799badc5”), I also used to add a column to the CSV with my own order numbers (1001, 1002, 1003…:wink:, in order of the time the order was completed. This functionality is very important; it’s the only way we can manage to quickly get orders out to about 700+ customers in a few hours. If there is still a way to get a CSV of all the orders, that would take care of everything – please let me know!

If there is not a way to export to CSV, what I would like to do is add a counter function that does two things – inserts numbers like 1001, 1002 to the filename, while counting up, and adding the same number to the packing slip and invoice titles in the templates for printing.

For example:

packing_730027338a87.pdf

would become:

packing_1001_730027338a87.pdf

and the next order would be packing_1002_[ID number].pdf, etc

I’ve found spots in the code where the pdf filename is generated, such as the below (found twice in class-mp-pdf-invoice.php):

if ( $type == self::PDF_INVOICE ) {
$file = 'invoice_' . $order->post_name . '.pdf';
} else {
$file = 'packing_' . $order->post_name . '.pdf';
}

and the title is generated in the templates invoice.php and packing.php – example:

<h3><?php _e( "Packing Slip", "mp" ) ?> #{{order_id}}</h3>

I realize this is a somewhat complicated post and request, and don’t want to overstep my support requests. If any support staff can help me figure out where in the code to insert an incremental counter, and have that variable be global/accessible and used by the invoice/packing slip code, that would be wonderful. I may be able to figure this all out myself, but any advice would be appreciated! And again, all of this is only necessary if there isn’t a way to export to CSV.

Thanks again,

Alex