Change Default Ticket Number from ‘0’ to ‘1’

Home Forums Ticket Products Event Tickets Plus Change Default Ticket Number from ‘0’ to ‘1’

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1233997
    James Faulknor
    Participant

    For any event registration page, I want to change the default number in the area where the user selects the number of tickets. Currently, the default is 0, but I want it to be 1. See this page as an example (go toward the bottom of the page–under “Register”, just before the “Add to Cart” button area).

    Thanks.

    #1234564
    Geoff
    Member

    Hi James,

    Great question! We actually have a post that provides detailed instructions for to change the default quantity of tickets from 0 to 1:

    https://theeventscalendar.com/knowledgebase/handling-ticket-quantities/

    Will that help you get started? Please let me know. 🙂

    Cheers!
    Geoff

    #1244042
    James Faulknor
    Participant

    Thanks for the reply. I tried that, exactly as laid out in the article. Unfortunately, it didn’t work. It still shows a ‘0’ as default. I made sure to clear the cache, etc.

    I tried replacing the tickets.php file directly in the plugins directory (i.e. /wp-content/plugins/event-tickets-plus/src/views/wootickets ) and it DID work. Obviously, though, that’s not the ideal way to do this.

    Please advise. Thanks.

    #1244091
    Geoff
    Member

    Hey James,

    Give this snippet a try instead:

    function tribe_events_alter_tickets_default_quantity() {
    wp_enqueue_script( 'jquery' );
    ?>
    <style>
    tr.tribe-tickets-meta-row {
    display: table-row !important;
    }
    </style>
    <script>
    jQuery(document).ready( function () {
    jQuery( 'input.text' ).val( 1 );
    });
    </script>
    <?php
    }
    add_action( 'wp_head', 'tribe_events_alter_tickets_default_quantity' );

    The snippet from the article was looking for a different class name and this one worked on my test site.

    Cheers!
    Geoff

    #1246251
    James Faulknor
    Participant

    Thanks, Geoff. Where would I put that snippet? Thanks.

    #1246511
    Geoff
    Member

    Hi James,

    You can add that to your functions.php file. 🙂

    Cheers!
    Geoff

    #1246559
    Erik
    Participant

    Added this function and it worked for me. Thanks!

    #1246564
    Geoff
    Member

    Heck yeah, glad to hear it Erik! Thanks for letting us know. 🙂

    James, hoping this works for you as well but let me know if you hit a snag along the way.

    Cheers!
    Geoff

    #1246607
    Erik
    Participant

    Reporting back- only issue is it was changing the page where you can update quantity to show a 1, instead of the quality you selected. So if I picked 4 tickets, when it shows the checkout page it’s auto filling the 1 there (even though it’s still counting as 4). Had to remove the function because of that.

    I don’t want to high jack the thread now either but now all the sudden none of my attendee data is being captured (and I REALLY need to find a way to get that attendee info on the tickets).

    site: http://eugeneypsummit.com/event/yp-test-ticket/

    If you could offer help or split me off in new thread that would be great. I followed up on some other forums but our launch date for registration is supposed to be in two days!!!

    Cheers,

    #1246870
    Geoff
    Member

    Hi Erik,

    Oh shoot, sorry about that! I made a small tweak to the snippet and it seemed to do the trick:

    function tribe_events_alter_tickets_default_quantity() {
    wp_enqueue_script( 'jquery' );
    ?>
    <style>
    tr.tribe-tickets-meta-row {
    display: table-row !important;
    }
    </style>
    <script>
    jQuery(document).ready( function () {
    jQuery( '.single-tribe_events input.text' ).val( 1 );
    });
    </script>
    <?php
    }
    add_action( 'wp_head', 'tribe_events_alter_tickets_default_quantity' );

    Hopefully that works for you (and James as well). I’m happy to help you in this thread as well since it is so closely related to the original question but please do feel free to open a new thread if you have additional questions about any thing else besides the snippet.

    Thanks so much!
    Geoff

    #1247029
    James Faulknor
    Participant

    Great! That worked perfectly. Thanks Geoff (and Erik).

    #1247041
    Geoff
    Member

    Right on! I’m so glad to hear everything is working smoothly and I appreciate you following up to let us know. Definitely keep us posted if any other questions come up and we’d be happy to help. 🙂

    Cheers!
    Geoff

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Change Default Ticket Number from ‘0’ to ‘1’’ is closed to new replies.