[Membership 2 Pro] Set Free Gateway to Manual Payment Gateway

Hi,

Previously Panos created a custom mu-plugin:

https://premium.wpmudev.org/forums/topic/membership-2-pro-admin-gateway-auto-renews#post-1378534

The plugin allowed you to change a membership from Payment Gateway: (None) Admin to Manual Payment Gateway. I have several hundred people who are Free Gateway and I want to change them to Manual Payment Gateway. Is there anyway to edit that custom mu-plugin to do that?

  • Dimitris
    • Support Star

    Hello there Stuart,

    hope you’re doing well and thanks for reaching us! :slight_smile:

    Wouldn’t what Adam shared here work for you?

    https://premium.wpmudev.org/forums/topic/membership-2-pro-admin-gateway-auto-renews#post-1378674

    Cause the Free Gateway means that these members are part of a membership that’s free, so you can’t actually change the payment option for them unless the membership level supports it.

    Please do let me know if I’m missing something else here. I’ve already pinged Panos on this, so he can edit the above snippet if needed.

    Thank you,

    Dimitris

  • Stuart
    • Design Lord, Child of Thor

    So my issue is because they started the membership free they have been able to renew for free. Instead of having to go in cancel and restart each account I wanted it to set it to Manual Payment. That way when the membership expires it knows to charge them and doesn’t just let them continue to renew for free.

  • Panos
    • SLS

    Hi Stuart !

    You can try out this mu-plugin:

    https://gist.github.com/wpmudev-sls/bd7550cf4d4d7521fe1bddcc2a834754

    Download, unzip and upload file ms-member-invoices.php to your wp-content/mu-plugins folder.

    It should add a new sub-menu under admin > Membership 2 > Bulk Invoices. Clicking on it, it should load a page that lists your public Memberships. The ui is poor there but I hope my instructions will help on this :slight_smile:

    You can click on the membership that has the free members. Their invoices should have amount set to 0. At the footer there are options to set new price (set your membership’s price) and invoice status, eg Pending or Billed. Set these options and click on the Set invoices price button.

    This lists 10 invoices each time. So after setting it for the first list, you will need to repeat until the list is empty. You can increase the number by setting the number you prefer in line ~22:

    private $limit = 10;

    Don’t set it to high though, as it might timeout your server.

    I would strongly recommend to first test this on a staging site. That way you can confirm if it works for you. You can then log in as one of those members (you can use plugin like https://wordpress.org/plugins/user-switching/), visit the checkout page and see if they still can subscribe for free.

    Kind regards!

  • Stuart
    • Design Lord, Child of Thor

    Thanks Panos,

    It helped somewhat but it only found about 40 something Free Memberships and there are still hundreds more.

    Here are some usernames of people who are still Free but not showing up on the mu-plugin you supplied.

    egn2323

    BSchnur

    Bcubana

  • Panos
    • SLS

    Hi Stuart ,

    So sorry for missing your reply! Just found that out while doing some housecleaning.

    That’s strange, not sure why it didn’t find the rest. I would need to have a look on your site in order to see why they are not found, so I would need admin and ftp access to your site. You can send that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:Subject: “Attn: Panos Lyrakis”

    – Admin login:

    Admin username

    Admin password

    Login url

    – FTP credentials

    host

    username

    password

    (and port if required)

    – link back to this thread for reference

    Kind regards!

  • Nahid
    • Tech Support

    Hey there Stuart !

    Hope you are doing well today!

    We apologize about the delay in response here. Unfortunately, we do not have an update from my colleague Panos regarding this yet. I have got in touch with him and requested him to get back to you on this ticket as soon as possible. As soon as we have an update regarding this, Panos, me or one of my colleagues will let you know here in this ticket.

    Please also note that Panos is a member of our Second Level Support team. Their response time is unfortunately not as fast as the general Support staff, as they usually deal with large numbers of advanced coding problems. We really appreciate your patience and consideration regarding this. Thanks!

    Kind regards,

    Nahid

  • Panos
    • SLS

    Hey Stuart !

    So sorry again! I haven’t seen any email coming in but I found ftp and admin info from other tasks.

    While was testing on your site I first noticed some error when using Memberhip’s function to fetch the Membersips. Bypassed it by making a custom query. However when I make bigger queries to fetch more invoices the site times-out. If this is a live site I don’t think I would be able to be doing more testing as site will probably keep timing out.

    In such case, could you, or ask your host to, create a staging site where I could run such tests?

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.