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.
-
AuthorPosts
-
April 10, 2018 at 10:37 am #1503310othernessParticipant
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.
April 10, 2018 at 10:58 am #1503324simpletheoryParticipantI 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>April 11, 2018 at 8:02 pm #1505027VictorKeymasterHi 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,
VictorMay 3, 2018 at 9:35 am #1522208Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Ticket quantity auto set to 1’ is closed to new replies.