Membership invoice for free plan?

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 8 reply threads
  • Author
    Posts
    • #78915
      me
      Participant

      Hi,

      If I enable invoices for membership subscriptions, then all free signups will get a $0 invoice, which is confusing and makes little sense. Is there a way to exclude the free plan from sending invoices?

      Thanks.

    • #79179
      WCFM Forum
      Member

      Hi,

      Well, if it’s for Free plan or Free Trial Period subscription then it will generate $0 amount invoice.

      But it will generate proper valued invoice when monthly subscription will be generate!

      Thank You

    • #79200
      me
      Participant

      That’s not my issue.

      I want to disable the $0 invoices, I don’t want any pdf attachments in the welcome email after free signups.
      The “WooCommerce PDF Invoices & Packing Slips” plugin, which is required for vendor invoices, has a setting for this, “Disable for free products”. It says “Disable automatic creation/attachment when only free products are ordered” – This is exactly what I need, but the membership plugin ignores this setting, maybe it doesn’t even use the invoice plugin at all?

      I found a filter in the membership plugin code that might help but I can’t figure out how to use it for this purpose.
      In core/class-wcfmvm.php, line 1048, there is the ‘wcfm_membership_subscription_attachment’ filter.
      How do I use this filter to send NO attachment if the membership id matches that of my free plan?

      Also, where can I modify the template of the membershio invoice?

      Thanks a lot

    • #79538
      WCFM Forum
      Member

      Hi,

      That’s possible.

      DO you have set “Basic Membership” at WCFM Membership setting ? https://ibb.co/BnX3rqm

      Thank You

    • #79539
      WCFM Forum
      Member

      Hi,

      That’s possible.

      DO you have set “Basic Membership” at WCFM Membership setting ? https://ibb.co/BnX3rqm

      Thank You

    • #79561
      me
      Participant

      Yes, I have.
      The problem I’m describing would be impossible to occur if I wouldn’t have done that.

      Attachments:
      You must be logged in to view attached files.
    • #79926
      WCFM Forum
      Member

      Hi,

      Please add this code to your site –

      add_filter( 'wcfm_is_allow_membership_subscription_invoice', function( $is_allow, $membership_id, $member_id ) {
      	if( function_exists('get_wcfm_basic_membership') ) {
      		$basic_membership = get_wcfm_basic_membership();
      		if( $basic_membership && ( $basic_membership == $membership_id ) ) {
      			$is_allow = false;
      		}
      	}
      	return $is_allow;
      }, 50, 3 );

      Add this code to your child theme’s functions.php
      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

      Thank You

      • #80002
        me
        Participant

        Thanks a lot!

        The snippet didn’t actually work at first, but I managed to debug it.
        First I got an ArgumentCountError, I fixed that but it was still sending invoices, so I decided to hardcode the membership_id into the function, and now it works fine:

        add_filter( 'wcfm_is_allow_membership_subscription_invoice', function( $is_allow ) {
        	if( function_exists('wcfm_get_membership')) {
                $active_membership = wcfm_get_membership();
        		if ( $active_membership = '83254') {
                    $is_allow = false;
                }
        	}
        	return $is_allow;
        }, 50, 3 );
        

        Thanks a lot for your help, I’m happy that we could solve this.

    • #80039
      WCFM Forum
      Member

      Hi,

      You were getting error because you not yet updated WCFM Ultimate to the latest version, 6.2.9

      Your code is not right, don’t use this.

      Thank You

      • #80090
        me
        Participant

        Ok, I’ll change it after the update. But why? What’s wrong with my version?

    • #80092
      WCFM Forum
      Member

      But why? What’s wrong with my version?

      – We have to check registered vendor’s membership. wcfm_get_membership() – this function does not return that.
      If you enable “Registration Approval” option then will stop working.

      Thank You

Viewing 8 reply threads
  • You must be logged in to reply to this topic.