Created
August 24, 2020 20:26
-
-
Save rafsuntaskin/9e6de1d7a917869f697ad03ce89cc9d1 to your computer and use it in GitHub Desktop.
Avoid default qty if more than 1 ticket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tribe_ext_set_default_qty_load_js', function ( $should_load ) { | |
$post = get_post(); | |
if ( empty( $post ) ) { | |
return $should_load; | |
} | |
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $post->ID ); | |
if ( $tickets > 1 ) { | |
$should_load = false; | |
} | |
return $should_load; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment