Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xlplugins/f51b8eff1ab6cd288413f4ec3bd6d449 to your computer and use it in GitHub Desktop.
Save xlplugins/f51b8eff1ab6cd288413f4ec3bd6d449 to your computer and use it in GitHub Desktop.
Unset Payment gatewy for specific checkout page- for client
<?php
class WFACP_TEMP_001 {
public function __construct() {
add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'actions' ] );
}
public function actions() {
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_payment_gatway' ] );
}
public function unset_payment_gatway( $gateways ) {
$wfacp_id = WFACP_Common::get_id();
if ( $wfacp_id == 71977) {
unset( $gateways['ppec_paypal'] );
}
return $gateways;
}
}
new WFACP_TEMP_001();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment