mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
add option to enable paypal in checkout
This commit is contained in:
parent
aee579f01a
commit
116837eadb
2 changed files with 16 additions and 0 deletions
|
@ -533,6 +533,18 @@ return array(
|
|||
'requirements' => array(),
|
||||
'gateway' => 'paypal',
|
||||
),
|
||||
'button_enabled' => array(
|
||||
'title' => __( 'Enable buttons on Checkout', 'paypal-for-woocommerce' ),
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable on Checkout', 'paypal-for-woocommerce' ),
|
||||
'default' => true,
|
||||
'screens' => array(
|
||||
State::STATE_PROGRESSIVE,
|
||||
State::STATE_ONBOARDED,
|
||||
),
|
||||
'requirements' => array(),
|
||||
'gateway' => 'paypal',
|
||||
),
|
||||
'button_layout' => array(
|
||||
'title' => __( 'Button Layout', 'paypal-for-woocommerce' ),
|
||||
'type' => 'select',
|
||||
|
|
|
@ -73,6 +73,10 @@ class DisableGateways {
|
|||
unset( $methods[ CreditCardGateway::ID ] );
|
||||
}
|
||||
|
||||
if ( $this->settings->has('button_enabled') && ! $this->settings->get('button_enabled') && ! $this->session_handler->order()) {
|
||||
unset( $methods[ PayPalGateway::ID] );
|
||||
}
|
||||
|
||||
if ( ! $this->needs_to_disable_gateways() ) {
|
||||
return $methods;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue