Tribe__Tickets_Plus__Commerce__WooCommerce__Settings::maybe_add_paypal_delay_settings( array $fields )
Conditionally adds paypal fields if WooCommerce has a PayPal gateway active
Contents
Parameters
- $fields
-
(array) (Required)
Return
(array) $fields
Source
File: src/Tribe/Commerce/WooCommerce/Settings.php
public function maybe_add_paypal_delay_settings( $fields ) {
$paypal = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::is_wc_paypal_gateway_active();
// bail if we don't have one
if ( empty( $paypal ) ) {
return $fields;
}
// add paypal checkbox
$fields['tickets-woo-paypal-delay'] = array(
'type' => 'radio',
'default' => 'delay',
'validation_type' => 'options',
'label' => __( 'Handling PayPal orders:', 'event-tickets-plus' ),
'options' => array(
'delay' => __( 'Wait at least 5 seconds after WooCommerce order status change before generating attendees and tickets in order to prevent unwanted duplicates. <i>Recommended for anyone using PayPal with WooCommerce.</i>', 'event-tickets-plus' ),
'immediate' => __( 'Generate attendees and tickets immediately upon WooCommerce order status change. Depending on your PayPal settings, this can result in duplicated attendees.', 'event-tickets-plus' ),
),
);
return $fields;
}
Changelog
| Version | Description |
|---|---|
| 4.10.1 | Introduced. |