Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
Forked from anonymous/segment__tickets.php
Created September 18, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theeventscalendar/395c8daab325775da9b4 to your computer and use it in GitHub Desktop.
Save theeventscalendar/395c8daab325775da9b4 to your computer and use it in GitHub Desktop.
Set a default quantity in the Ticket form
woocommerce_quantity_input( array(
'input_name' => 'quantity_' . $ticket->ID,
'input_value' => 0,
'min_value' => 0,
'max_value' => $max_quantity,
) );
@KillerDesigner
Copy link

Thanks for this snippet, which sets initial quantity to "0", but does not allow quantity to return to "0" after being increased to any other integer (see here: http://www.screencast.com/t/zFuRmUZMjn) however, setting 'min_value' to "-1" allows quantity to set to "0" and "-1".

Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment