WC_Gateway_Paypal::hide_action_buttonspublicWC 1.0

Hide "Pay" and "Cancel" action buttons for pending orders as orders v2 takes a while to be captured.

Method of the class: WC_Gateway_Paypal{}

No Hooks.

Returns

Array.

Usage

$WC_Gateway_Paypal = new WC_Gateway_Paypal();
$WC_Gateway_Paypal->hide_action_buttons( $actions, $order );
$actions(array) (required)
An array with the default actions.
$order(WC_Order) (required)
The order.

WC_Gateway_Paypal::hide_action_buttons() code WC 10.5.0

public function hide_action_buttons( $actions, $order ) {
	if ( $this->should_use_orders_v2() && $this->id === $order->get_payment_method() ) {
		unset( $actions['pay'], $actions['cancel'] );
	}
	return $actions;
}