There is a native, handy way to get a WooCommerce customer’s last order: wc_get_customer_last_order( $customer_id )
This time, I want to write some custom code to get the second last order instead. We will indeed reuse most of the above function code and change it slightly. Enjoy!
Continue reading WooCommerce: Get Customer Second Last Order