Home › Forums › Calendar Products › Community Events › URGENT – Event Community Form – Hide/Disable fields
- This topic has 8 replies, 2 voices, and was last updated 8 years ago by Brook.
-
AuthorPosts
-
March 26, 2016 at 8:04 am #1094393CesarParticipant
Hi TEC,
I was running v4.0.7 and everything was good. However, after updating to v4.10 some parts of my web site went wrong.
One of my biggest problems is during a community event submit. Basically some fields are displaying and I dont know why:
Event Community FormDo you have any clue about how to solve this please? My Web site go out this week :/
Thank you.
- This topic was modified 8 years, 1 month ago by Cesar.
March 27, 2016 at 6:21 am #1094560CesarParticipantHi again,
I was able to solve my problem with the “bizarres” tickets appearing by default. Now it’s OK.However, I still wonder how to set WooCommerce ticket as default for all ticket submits (I’m not interesting in RSVP)?
Thank you.
CesarMarch 28, 2016 at 11:37 pm #1095250BrookParticipantHowdy Cesar,
I would love to help you with this.
However, I still wonder how to set WooCommerce ticket as default for all ticket submits(I’m not interesting in RSVP)?
In order to alter this you will need to create a theme override. If you have not created on of those yet then checkout our Themer’s Guide for a step-by-step on this process. With that knowledge in hand create an override for this file: /the-events-calendar-community-tickets/src/views/community-tickets/modules/tickets.php On line 55 you will see the following:
Tribe__Tickets__Tickets_Handler::instance()->do_meta_box( $event );
This line outputs the entire ticket sales area. We are going to want to replace it with our own custom ticket area. The first step to doing this is to to delete that line add the following, taken from that do_meta_box function:
$startMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null ); $endMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null ); $startHourOptions = Tribe__View_Helpers::getHourOptions( null, true ); $endHourOptions = Tribe__View_Helpers::getHourOptions( null, false ); $startMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null, true ); $endMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null ); $show_global_stock = Tribe__Tickets__Tickets::global_stock_available(); $tickets = Tribe__Tickets__Tickets::get_event_tickets( $event->ID ); $global_stock = new Tribe__Tickets__Global_Stock( $event->ID );
Now you will want to copy/paste everything inside of this file: public_html/wp-content/plugins/event-tickets/src/admin-views/meta-box.php just below the above code. Now you have full control over the tickers area! You can modify it to your hearts content including changing the default.
On line 130 of the above file you will see the following code:
<?php $checked = true; foreach ( $modules as $class => $module ) { ?> <input <?php checked( $checked ); ?> type="radio" name="ticket_provider" id="ticket_provider" value="<?php echo esc_attr( $class ); ?>" class="ticket_field"> <span><?php echo esc_html( $module ); ?></span> <?php $checked = false; }
This is what outputs the ticket options, and chooses the default. If you wanted it to select Woo by default then swap it out for this code:
<?php foreach ( $modules as $class => $module ) { $checked = $module === 'WooCommerce'; ?> <input <?php checked( $checked ); ?> type="radio" name="ticket_provider" id="ticket_provider" value="<?php echo esc_attr( $class ); ?>" class="ticket_field"> <span><?php echo esc_html( $module ); ?></span> <?php } ?>
Does that all make sense? Will that work for you? Please let me know.
Cheers!
– Brook
March 29, 2016 at 1:06 pm #1095592CesarParticipantHi Brook,
Thanks for your support. I could not make it, tho.
1) I edited the file /public_html/demo/wp-content/themes/leezgo/tribe-events/community-tickets/modules/tickets.php on line 55.
It looks like this: tickets.php2) What should I do with this code?
$startMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null );
$endMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null );
$startHourOptions = Tribe__View_Helpers::getHourOptions( null, true );
$endHourOptions = Tribe__View_Helpers::getHourOptions( null, false );
$startMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null, true );
$endMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null );$show_global_stock = Tribe__Tickets__Tickets::global_stock_available();
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $event->ID );
$global_stock = new Tribe__Tickets__Global_Stock( $event->ID );Put those lines at the end the file /public_html/demo/wp-content/themes/leezgo/tribe-events/community-tickets/modules/tickets.php? Same for the content of meta-box.php?
March 30, 2016 at 2:37 pm #1096120BrookParticipantHowdy Cesar,
Thanks for the screenshot! You found the right line of code there. Put this underneath it:
$startMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null ); $endMinuteOptions = Tribe__View_Helpers::getMinuteOptions( null ); $startHourOptions = Tribe__View_Helpers::getHourOptions( null, true ); $endHourOptions = Tribe__View_Helpers::getHourOptions( null, false ); $startMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null, true ); $endMeridianOptions = Tribe__View_Helpers::getMeridianOptions( null ); $show_global_stock = Tribe__Tickets__Tickets::global_stock_available(); $tickets = Tribe__Tickets__Tickets::get_event_tickets( $event->ID ); $global_stock = new Tribe__Tickets__Global_Stock( $event->ID );
Then put the contents of public_html/wp-content/plugins/event-tickets/src/admin-views/meta-box.php underneath that, and make the small modification I outlined.
That help clarify things?
Cheers!
– Brook
March 31, 2016 at 2:17 pm #1096657CesarParticipantNo luck buddy 🙁
/public_html/demo/wp-content/themes/leezgo/tribe-events/community-tickets/modules/tickets.php
tickets.phpSorry if I’m missing something obvious.
April 1, 2016 at 11:48 am #1097189BrookParticipantHmm it looks like a syntax error.
What if you just copy/paste this file, replacing the contents of your current one? It should not have any syntax errors:
https://gist.github.com/elimn/9270713f8539e3bd8178d35759d9b79a
Did that work?
Cheers!
– Brook
April 5, 2016 at 7:44 am #1098305CesarParticipantHi Brook!
You’re the best, definitively TEC support rocks! (Yes, it worked.)
Thank you very much.
April 5, 2016 at 8:41 am #1098338BrookParticipantExcellent! It’s been my pleasure. Let us know if ever you need anything else.
Cheers!
– Brook
-
AuthorPosts
- The topic ‘URGENT – Event Community Form – Hide/Disable fields’ is closed to new replies.