Skip to content

Instantly share code, notes, and snippets.

@actual-saurabh
Last active July 23, 2018 17:15
Show Gist options
  • Save actual-saurabh/9aca5b51d84868480a370e5d21e99327 to your computer and use it in GitHub Desktop.
Save actual-saurabh/9aca5b51d84868480a370e5d21e99327 to your computer and use it in GitHub Desktop.
Create a trial on a one time payment access plan
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_get_product_schedule_details', 'llms_one_time_payment_trial', 10, 2 );
function llms_one_time_payment_trial( $schedule_message, $access_plan ) {
/* get access plan id from next to the Access Plan's Title, for eg:
* "Test Access (ID# 1322)"
* The Access Plan's id is 1322
*/
$access_plan_ids = array( 1322 ); // add more ids with commas, eg, "array( 1322, 1432, 1565 )"
if( ! in_array( (int) $access_plan->id, $access_plan_ids ) ) {
return $schedule_message;
}
// replace the text within the inverted commas with whatever you like. Make sure to add a space at the beginning.
return " one time payment, after trial";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment