Skip to content

Instantly share code, notes, and snippets.

@cliffordp cliffordp/functions.php
Last active Mar 30, 2018

What would you like to do?
Set default quantity of 1 for all ET and ET+ tickets: RSVP, Woo, EDD
* Set default quantity of 1 for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
* From
* Same as this snippet but also make the quantity readonly:
* ! You may want to use instead!
function cliff_all_tickets_default_quantity() {
// bail if not on a Single Event page
if ( ! function_exists( 'tribe_is_event' ) || ! tribe_is_event() ) {
return false;
wp_enqueue_script( 'jquery' );
<script type="text/javascript">
jQuery(document).ready( function () {
// RSVP, Woo, and EDD tickets default to quantity of 1
jQuery( 'input.tribe-ticket-quantity, .woocommerce .quantity input.qty, .edd.quantity input.edd-input' ).val( 1 );
// CSS to display RSVP tickets' "Send RSVP confirmation to" fields
// Note: will continue to show even if user changes quantity to zero because we didn't bind to the field to continually watch it
jQuery( 'tr.tribe-tickets-meta-row' ).show();
add_action( 'wp_footer', 'cliff_all_tickets_default_quantity' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.