Add Send invoice button to front end invoices history

This topic contains 7 replies, has 3 voices, and was last updated by  Kiran 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #643

    Laura Venturini
    Buyer
    Post count: 36

    Hi,

    I’m using Invoicing with WP Geo Directory and BuddyPress.

    I need to add a button that send the invoice via mail to customer in the frontend invoices history, near the buttons “Pay now” and “Print”.

    Actually a button like the one that I found in the backend of plugin, but in front end.

    Can you adress me to add this feature?

    I attach an image to figure out what I need.

    Thanks!

    #645

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    Hi Laura,

    I am not sure how this would help? The send via email then just links to the print view so, its quicker just to click the print view, i am missing something?

    Thanks,

    Stiofan

    #646

    Laura Venturini
    Buyer
    Post count: 36

    Our business model have commercial agents that register users and add for them first listing.
    After that we need to send via mail the link for payment to user: if you can suggest us a different way we will appreciate. 🙂

    #647

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    The function that would be used would be this wpinv_user_invoice_notification( $invoice_id )
    but i guess we set to to not send in pricing manager somehow, i’ll flag this for kiran to see if there is a hook that can be used to auto send them when adding a listing.

    Thanks,

    Stiofan

    #648

    Laura Venturini
    Buyer
    Post count: 36

    Ok thanks, hope to hear from you soon!

    #649

    Kiran
    Moderator
    Post count: 7069

    Hi Laura,

    Add following snippet code via any snippet plugin. This will send invoice to user whenever new invoice created.

    
    
    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 );
            }
        }
    }
    add_action( 'geodir_payment_invoice_created', '_gd_wpi_custom_send_new_invoice', 100, 3 );

    Thanks,
    Kiran

    #650

    Laura Venturini
    Buyer
    Post count: 36

    Thanks Kiran, it made the job!

    Thanks for your 5 stars support! 🙂

    #651

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket