- Use this code in your Function Editor and leave the Totals field empty.
- This will work with your import using the current tax rates, it won't work for any past rates.
- Keep in mind that this is an example function, and you may need to modify it to work on your site.
function my_recalc_order( $post_id, $xml_node, $is_update ) {
// Retrieve the import ID.
$import_id = wp_all_import_get_import_id();
// Change '1' to your import ID.
if ( $import_id == '1' ) {
$order = new \WC_Order( $post_id );
$order->calculate_totals( );
}
}
add_action( 'pmxi_saved_post', 'my_recalc_order', 10, 3 );