Tribe__Tickets_Plus__Commerce__WooCommerce__Cart::maybe_set_empty_checkout_url( string $checkout_url )
Maybe set the empty checkout URL to our known checkout URL.
Contents
Parameters
- $checkout_url
-
(string) (Required) Checkout URL.
Return
(string) Checkout URL.
Source
File: src/Tribe/Commerce/WooCommerce/Cart.php
public function maybe_set_empty_checkout_url( $checkout_url ) {
if ( empty( $checkout_url ) ) {
remove_filter( 'woocommerce_get_checkout_url', [ $this, 'maybe_filter_checkout_url_to_attendee_registration' ], 12 );
$checkout_url = $this->get_checkout_url();
add_filter( 'woocommerce_get_checkout_url', [ $this, 'maybe_filter_checkout_url_to_attendee_registration' ], 12 );
}
/** @var \Tribe__Tickets_Plus__Commerce__WooCommerce__Main $woo */
$woo = tribe( 'tickets-plus.commerce.woo' );
$ticket_provider = $woo->attendee_object;
$checkout_url = add_query_arg( 'provider', $ticket_provider, $checkout_url );
return $checkout_url;
}
Changelog
| Version | Description |
|---|---|
| 4.12.0 | Stop adding the 'provider' parameter to the checkout URL, was causing conflicts with payment gateways. |
| 4.11.2 | Do not add 'provider' to checkout URL if no tickets in the Cart. |
| 4.11.0 | Introduced. |