Imported orders in WooCommerce may sometimes display incorrect tax labels and totals in third-party PDF invoice plugins such as WP Overnight PDF Invoices. This can happen when orders are imported using the Order Import Export for WooCommerce plugin without triggering WooCommerce’s internal total recalculation.
In such cases, the order may appear correct only after manually clicking Update or Recalculate on the WooCommerce order edit page. To avoid this, you can add a custom code snippet to recalculate the order totals automatically during import.
Follow the steps mentioned below:
- From the WordPress admin dashboard, navigate to Appearance > Theme File Editor.
- Under Theme Files, select Theme Functions (functions.php).
- Paste the code snippet at the end of the
functions.phpfile of your active child theme. - Save the changes.
Code snippet: