Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PMPro Adjust start date to the first following Sunday.
/*
Adjust start date to the first following Sunday
*/
//at checkout
function my_pmpro_checkout_start_date($startdate)
{
//which day is it
$checkout_day = date("N");
//days to sunday
$days_to_sunday = 7 - $checkout_day;
//add the days
$startdate = date("Y-m-d", strtotime("+ " . $days_to_sunday . " days"));
return $startdate;
}
add_filter('pmpro_checkout_start_date', 'my_pmpro_checkout_start_date');
@jberm4

This comment has been minimized.

Copy link

commented Feb 9, 2016

I noticed that this doesn't work because you have the date format wrong. Should be Y-m-d otherwise the date resets to 01-01-1970.

@ghost

This comment has been minimized.

Copy link
Owner Author

commented Sep 12, 2016

@jberm4 Thanks. Fixed it.

@davbross

This comment has been minimized.

Copy link

commented Sep 13, 2016

@stranderstudios First ... thanks.

Second, I'm a total newbie.

2 things, how would I get new purchasers to only get access to the content on the first monday of the month, then drip out content every 7 days? I attached images, so hopefully this will make sense.

person buys on the 9th of the month. and, on the following First Monday of the Next Month, somehow I'll email them login credentials (via InfusionSoft) and when they login the first time, they gain access to "week 1 access" and all of the pages built there. Then, 7 days later, they can access "week 2 access" and all of the pages / videos associated with that week. Then, so on until they complete the 4 week training.

As you can see, I'm building this with OP2, but there are many limitations to giving access in the manner in which I would like, so I'll need to convert this out of OP2.

week 1 access

week 2 access

As you can see, I'm building this with OP2, but there are many limitations to giving access in the manner in which I would like, so I'll need to convert this out of OP2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.