Affiliates and Membership 2 Pro

So I don't have a trial period in the member levels. They pay immediately for access, but can cancel within 30 days and get a refund.

Is there a way to indicate a waiting period of time similar to a trial period even though a paying signup has been made?

  • Panos
    • SLS

    Hey sorry for delay here. If I understand correctly, you need to delay the balance to show up in affiliate's admin page as a member that has already paid may cancel right?

    If this is the case I just prepared a mu-plugin that should do that which you can download from here :
    https://gist.github.com/wpmudev-sls/f2a3bb4c3ef9f3289d91386bb2b326e5
    Unzip it and upload file aff-m2-charge-delay.php to your wp-content/mu-plugins folder. If that folder doesn't exist (it doesn't in some hosts) you can simply go ahead and create it via ftp or cPanel.

    In order to test, the simplest way would be to change line:
    private static $delay_days = 30;
    to
    private static $delay_days = 1;
    and do a few tests which you can confirm the following day. You can do more advanced tests by using the Crontrol plugin and changing the timestamps in the _wpmudev_aff_pending_balance_items_list option name in the options db table. In that option you can set each item 30+ days back by changing each timestamp in that weird (serialized) string there via phpMyAdmin. A simple timestamp converter you can use is https://www.epochconverter.com/. There you can get a timestamp for 30 in the past and replace that in the option mentioned here.

    After you have replaced that, from the Crontrol page (wp admin > Tools > Cron Events) you can run the wpmudev_aff_pending_balance_scheduled_check schedule whenever you need by clicking on the "Run now" link. You can do that before and after replacing those timestamps and each time check the affiliate's page.

    I strongly suggest to first try this out in a staging/testing site.

    Hope this helps!

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.