Home › Forums › Ticket Products › Event Tickets Plus › Change Default Ticket Number from ‘0’ to ‘1’
- This topic has 12 replies, 4 voices, and was last updated 9 years, 1 month ago by
James Faulknor.
-
AuthorPosts
-
February 13, 2017 at 11:52 am #1233997
James Faulknor
ParticipantFor 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.
February 14, 2017 at 8:34 am #1234564Geoff
MemberHi 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!
GeoffFebruary 22, 2017 at 2:19 pm #1244042James Faulknor
ParticipantThanks 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.
February 22, 2017 at 3:25 pm #1244091Geoff
MemberHey 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!
GeoffFebruary 27, 2017 at 8:36 am #1246251James Faulknor
ParticipantThanks, Geoff. Where would I put that snippet? Thanks.
February 27, 2017 at 2:46 pm #1246511Geoff
MemberHi James,
You can add that to your functions.php file. 🙂
Cheers!
GeoffFebruary 27, 2017 at 3:58 pm #1246559Erik
ParticipantAdded this function and it worked for me. Thanks!
February 27, 2017 at 4:18 pm #1246564Geoff
MemberHeck 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!
GeoffFebruary 27, 2017 at 7:24 pm #1246607Erik
ParticipantReporting 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,
February 28, 2017 at 7:13 am #1246870Geoff
MemberHi 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!
GeoffFebruary 28, 2017 at 9:02 am #1247029James Faulknor
ParticipantGreat! That worked perfectly. Thanks Geoff (and Erik).
February 28, 2017 at 9:27 am #1247041Geoff
MemberRight 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 -
AuthorPosts
- The topic ‘Change Default Ticket Number from ‘0’ to ‘1’’ is closed to new replies.
