Export Functionality not working.
-
Hello,
I had an issue with the export not working trying to export 5 orders. Since I am a developer, I looked at the error. In your file /wc-customer-source/includes/wccs-admin-export.php where you are calling the get_billing_first_name() on the order. It errors on a refunded or failed order. This is because a refunded order is not a WC_Order. I added a check to make sure that the order you are exporting is a WC_Order and if not to get the parent order.
I added four lines to your code after the foreach begins: Line 64 or so.
//In cases where the order is actually a refund or failed then the billing last name is not set. You must get the parent order. if ( ! is_a( $order, 'WC_Order' ) ) { $order = new WC_Order( $order->get_parent_id() ); }This will get the parent order if the order is not a valid WC Order. Please implement this fix in the next version. We were able to export over 100 orders after this fix.
Thank you.
The topic ‘Export Functionality not working.’ is closed to new replies.