From https://wpinvoicing.com/support/topic/split-no-payment-option/#post-904


function _gd_wpi_custom_send_new_invoice( $invoice_id ) {
    global $wpi_gdp_inv_merge;

    if ( !empty( $wpi_gdp_inv_merge ) ) {
        return; // Bail when merging invoices via tool.
    }

    $gd_invoice = geodir_get_invoice( $invoice_id );

    if ( !empty( $gd_invoice->invoice_id ) ) {
        $wpi_invoice = wpinv_get_invoice( $gd_invoice->invoice_id );

        if ( !empty( $wpi_invoice->ID ) ) {
            // Send invoice to user.
            wpinv_user_invoice_notification( $wpi_invoice->ID );
            
            // Send invoice to admin.
            wpinv_new_invoice_notification( $wpi_invoice->ID );
        }
    }
}
add_action( 'geodir_payment_invoice_created', '_gd_wpi_custom_send_new_invoice', 100, 3 );

Please log in to rate this.

0 people found this helpful.


Category: Notifications, Snippets

← FAQs

Leave a Reply

Your email address will not be published. Required fields are marked *