How to enable create Invoice in bulk updates

By default shipment is created without invoice, when the plugin WPCargo Invoice Addon is installed every shipment created it will generate invoice. To create Invoice to the OLD shipment you have to update it one by one.

Copy this codes to apply create Invoice in the bulk update in your themes functions.php file


if( function_exists('wpcinvoice_save_shipment_callback') ){

    add_action( 'wpcr_after_save', 'wpcinvoice_save_shipment_callback', 10, 2 );

    function wpcinvoice_after_bulk_shipment_callback( $shipment_ids, $post_data  ){
        if( empty( $shipment_ids ) || !is_array($shipment_ids) ){
            return false;
        }
        foreach ( $shipment_ids as $shipment_id ) {
            wpcinvoice_save_shipment_callback( $shipment_id, $post_data );
        }
    }

    add_action( 'wpcfe_after_save_bulk_assign_shipment', 'wpcinvoice_after_bulk_shipment_callback', 10, 2 )
}

0
    0
    Your Cart
    Your cart is emptyReturn to Shop