Skip to content

Instantly share code, notes, and snippets.

@growdev
Created April 22, 2020 19:41
Show Gist options
  • Save growdev/cc45552811345ef6ea984662c3a5ed49 to your computer and use it in GitHub Desktop.
Save growdev/cc45552811345ef6ea984662c3a5ed49 to your computer and use it in GitHub Desktop.
Toolbox for WC Subscriptions: Add this to theme functions file to allow manual renewal payment gateways to skip and set date.
<?php
/**
* Remove the check for if a payment gateway supports "Date change"
*/
remove_filter( 'wcs_view_subscription_actions', 'Javorszky\\Toolbox\\remove_actions', 20 );
/**
* Allow date changes on subscriptions that are manual
* @param $subscription
* @return string
*/
function sp_allow_manual_date_change( $subscription ) {
return 'yes';
}
add_filter('jgtb_allow_edit_date_for_subscription', 'sp_allow_manual_date_change', 50 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment