Ticket quantity auto set to 1

Home Forums Ticket Products Event Tickets Plus Ticket quantity auto set to 1

  • This topic has 2 replies, 3 voices, and was last updated 6 years ago by otherness.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1503310
    otherness
    Participant

    Hello is there a way to auto set the ticket quantity to 1?

    Currently it defaults to 0, so if I click on ‘Buy Ticket’ it doesn’t add the ticket to basket.

    #1503324
    simpletheory
    Participant

    I was able to set my default value to one with jquery, and also limit one ticket per purchase. If you don’t want to limit it, just remove the prop() at the end. Also make sure the input class name matches yours.

    <script type=”text/javascript”>
    jQuery(document).ready( function () {
    jQuery( ‘input.input-text.qty.text’ ).val( 1 ).prop( ‘readonly’, true );
    });
    </script>

    #1505027
    Victor
    Keymaster

    Hi Russel and Tam!

    Thanks for getting in touch with us!

    There is not a built-in option to achieve that, but the snippet Tam shared is one possible way to do so.

    Another way to do it is overriding the tickets.php. You can learn more about overriding calendar templates in our Themer’s Guide, but it basically boils down to this:

    • Make a copy of the tickets.php template. It is located at/wp-content/plugins/event-tickets-plus/src/views/wootickets/tickets.php
    • Make a new folder in your theme called tribe-events
    • Make a new folder in that one called wootickets
    • Drop your copied tickets.php file in that last folder

    Now that the template is in your theme, you should modify line 128 and change the code to look like this:

    'input_value' => 1,

    I hope that helps! Let us know if any follow up questions.

    Best,
    Victor

    #1522208
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Ticket quantity auto set to 1’ is closed to new replies.