Skip sending Invoice Notifications on free package

This topic contains 4 replies, has 3 voices, and was last updated by  directoryfan 4 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #526679

    directoryfan
    Expired Member
    Post count: 157

    Hello Support Team,

    after updating to v2 I can not stop sending invoice notifications on the free package.

    – free packages are in the CPT settings set and synchronized with Invoicing plugin
    – package field is active in the custom fields
    – your snippet for skipping this is also active:

     
    
    /**
     * Prevent sending invoice email notifications to user for free invoices.
     */
    function gd_snippet_prevent_invoice_email_for_free_listing( $recipient, $email_type, $invoice_id, $invoice ) {
    	if ( class_exists( ‘GeoDir_Pricing_Post_Package’ ) && ! empty( $invoice ) && $invoice->is_free() ) {
    		$post_packages = GeoDir_Pricing_Post_Package::get_items( array( ‘invoice_id’ => $invoice_id ) );
    
    		if ( ! empty( $post_packages ) ) {
    			$recipient = NULL; // No recipient.
    		}
    	}
    	return $recipient;
    }
    add_filter( ‘wpinv_email_recipient’, ‘gd_snippet_prevent_invoice_email_for_free_listing’, 100, 4 );

    – cache deleted

    When a listing is added the Invoicing plugin is still sending the invoice to the user.

    How can I stop this, do I missing something?

    Thank you for your support!
    Greetings, Marius

    #526682

    directoryfan
    Expired Member
    Post count: 157
    This reply has been marked as private.
    #526718

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #526807

    Kiran
    Moderator
    Post count: 7069

    Hi Marius,

    There are illegal single quotes in PHP snippet you used.

    Try PHP snippet again from here https://wpgeodirectory.com/support/topic/invoices-of-0-00-euros-being-sent-for-free-listings/#post-486780

    Regards,
    Kiran

    #526928

    directoryfan
    Expired Member
    Post count: 157

    Hello Kiran and thank you for your help!

    Sorry for that, that I have not checked this by my self, I just did a copy and paste from the docs: https://wpgeodirectory.com/docs-v2/addons/pricing-manager/#free-skip-invoice-email

    Thanks again for the quick help!
    Marius

Viewing 5 posts - 1 through 5 (of 5 total)

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

Open Support Ticket