URGENT – Event Community Form – Hide/Disable fields

Home Forums Calendar Products Community Events URGENT – Event Community Form – Hide/Disable fields

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1094393
    Cesar
    Participant

    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 Form

    Do 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.
    #1094560
    Cesar
    Participant

    Hi 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.
    Cesar

    #1095250
    Brook
    Participant

    Howdy 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

     

    #1095592
    Cesar
    Participant

    Hi 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.php

    2) 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?

    #1096120
    Brook
    Participant

    Howdy 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

    #1096657
    Cesar
    Participant

    No luck buddy 🙁

    Website error

    /public_html/demo/wp-content/themes/leezgo/tribe-events/community-tickets/modules/tickets.php
    tickets.php

    Sorry if I’m missing something obvious.

    #1097189
    Brook
    Participant

    Hmm 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

    #1098305
    Cesar
    Participant

    Hi Brook!

    You’re the best, definitively TEC support rocks! (Yes, it worked.)

    Thank you very much.

    #1098338
    Brook
    Participant

    Excellent! It’s been my pleasure. Let us  know if ever you need anything else.

    Cheers!

    – Brook

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘URGENT – Event Community Form – Hide/Disable fields’ is closed to new replies.