Home › Forums › Ticket Products › Event Tickets Plus › Default Ticket number Setting
- This topic has 4 replies, 2 voices, and was last updated 8 years, 1 month ago by
Arthur Zetes.
-
AuthorPosts
-
March 19, 2018 at 2:12 am #1482700
Arthur Zetes
ParticipantHey guys
The default ticket number on events pages is currently set to 0.
How do I change it to default to 1?
I’m editing tickets.php and have edited the min_value as such
/**
* Filter classes on the Price column
*
* @since 4.3.2
*
* @param array $column_classes
*/
$column_classes = (array) apply_filters( ‘tribe_events_tickets_woo_quantity_column_class’, array( ‘woocommerce’ ) );
echo ‘<td class=”‘ . esc_attr( implode( ‘ ‘, $column_classes ) ) . ‘” data-product-id=”‘ . esc_attr( $ticket->ID ) . ‘”>’;if ( 0 !== $available ) {
// Max quantity will be left open if backorders allowed, restricted to 1 if the product is
// constrained to be sold individually or else set to the available stock quantity
$stock = $ticket->stock();
$max_quantity = $product->backorders_allowed() ? ” : $stock;
$max_quantity = $product->is_sold_individually() ? 1 : $max_quantity;
$available = $ticket->available();woocommerce_quantity_input( array(
‘input_name’ => ‘quantity_’ . $ticket->ID,
‘input_value’ => 1,
‘min_value’ => 1,
‘max_value’ => $must_login ? 0 : $max_quantity, // Currently WC does not support a ‘disable’ attribute
) );I followed the themers guide, but i am not quite sure about the correct folder hierarchy
I created the
/child-theme/tribe-events
hierarchy so far, but im not seeing any changes when i upload the adjust tickets.php file to the folder.
thanks,
Arthur
March 20, 2018 at 6:17 am #1483808Victor
MemberHi Arthur!
Thanks for getting in touch with us! I’d be happy to help you with this topic.
First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.
That said, we always like helping out and at least point users into the right direction as much possible.
You are on the right track modifying the code. Setting the
‘min_value’ => 1,
for the woocommerce_quantity_input() function is the way to achieve that.You can learn more about overriding calendar templates in our <u>Themer’s Guide</u>, but it basically boils down to this:
- Make a copy of the tickets.php template. It is located at wp-content/plugins/events-tickets-plus/src/views/wootickets/tickets.php
- Make a new folder in your active 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 can modify it to suit your needs.
Will this work for you? Please let me know. 🙂
Best,
VictorMarch 22, 2018 at 6:36 am #1485820Arthur Zetes
ParticipantThanks! This fixed it.
As far as the themer’s guide documentation, I read it. I got stuck on how to name the folders.
The part that confused me in the documentation was this:
Create a new folder inside /tribe-events for specific premium addons:
Community Events: /tribe-events/community/
Events Calendar Pro: /tribe-events/pro/
Event Tickets: /tribe-events/tickets/
Filter Bar: /tribe-events/filter-barso, if you guys listed the folder names for each addon, or if you mention to “use the name of the folder in the src/views/ directory” that would make it clearer.
thanks!
March 23, 2018 at 4:46 am #1486796Victor
MemberHi Arthur!
Glad you could make it work as you expected. Thanks for following up to let us know.
Thanks for the suggestion on how to make it clearer in the Themer’s Guide. We’re always trying to improve our knowledgebase articles and feedback like yours is definitely appreciated.
I’ll pass this along to the team so we can take it into account next time we update the article.
I’ll go ahead and close this thread now, but feel free to open a new topic if anything comes up and we’ll be happy to help.
Cheers,
Victor -
AuthorPosts
- The topic ‘Default Ticket number Setting’ is closed to new replies.
