How to edit the submit an event form

Home Forums Ticket Products Community Tickets How to edit the submit an event form

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1050961
    Matthew
    Participant

    Hi,

    I’ve browsed the forum but unfortunately can’t find the answer, should just be a quick question.

    I want to edit the ‘submit an event’ form for my community users. Specifically I want to add ‘USD’ after ‘Price’ in the ‘Add New Ticket’ section of the submission form.

    I can’t find the template for the community submission form or the add new ticket section of it. Where do I find it so I can edit it using the guidelines in the themers guide?

    Thanks,
    Mat

    #1051983
    Brian
    Keymaster

    Hi Mat,

    Sorry for the delay in getting to you on this.

    The files that controls this is an admin file here:

    plugins/event-tickets/src/admin-views/meta-box.php

    plugins/event-tickets-plus/src/admin-views/woocommerce-metabox-advanced.php

    plugins/event-tickets-plus/src/admin-views/price-fields.php

    So they cannot be directly edited or moved to the theme.

    We have this guide instead that might help change a word:

    https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/

    The text domain is:

    event-tickets-plus

    and this might work for the custom text in the snippet on that guide:

    $custom_text = array(
    'Price:' => 'Price: (USD)',
    );

    Cheers

    #1052569
    Matthew
    Participant

    Thanks for getting back to me Brian.

    I put that snippet in my custom plugin (I use this instead of the functions.php) and unfortunately nothing has changed on the Submit an Event page. You can see where I put the code in this screenshot:

    https://nimbus.everhelper.me/client/notes/share/366470/ZnbWbcwHI0usWcc09Zv2VpRVQVa33SgM/

    Have I entered something incorrectly?

    Thanks,
    Mat

    #1052618
    Brian
    Keymaster

    Hi,

    Please look at the snippet in the article I referenced.

    It is a piece of that snippet.

    Cheers

    #1052955
    Matthew
    Participant

    Hi Brian,

    I had read that article 3 times, it’s not very easy to understand.

    After trying a bunch of different stuff I found I already had that snippet in my site plugin:

    http://nimb.ws/qpR9vy

    If I paste the snippet again later the site breaks and it tells me I cant ‘redeclare function tribe_custom_theme_text’.

    I tried modifying the code to include the snippet you gave me but that doesn’t do anything. I presume I need to specify the text domain somehow?

    This is what I tried, the site didn’t break but nothing happens to ‘Price’:

    /*
     * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
     * See the codex to learn more about WP text domains:
     * <a href="http://codex.wordpress.org/Translating_WordPress#Localization_Technology" rel="nofollow">http://codex.wordpress.org/Translating_WordPress#Localization_Technology</a>
     * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
     */
    function tribe_custom_theme_text ( $translations, $text, $domain ) {
     
        // Put your custom text here in a key > value pair
        // Example: 'Text you want to change' > 'This is what it will be changed to'
        // The text you want to change is the key, and it is case-sensitive
        // The text you want to change it to is the value
        // You can freely add or remove key > values, but make sure to separate them with a comma
        $custom_text = array(
            'Location' => 'Enter a City, Zip or Postcode',
          	'Price:' => 'Price: (USD)',
        );
    
        // If this text domain starts with "tribe-", and we have replacement text
        if(strpos($domain, 'tribe-') === 0 && array_key_exists($text, $custom_text) ) {
            $text = $custom_text[$text];
        }
     
        return $text;
    
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);

    How do I change the word ‘Price’ and keep my changes to the word ‘Location’?

    Thanks,
    Mat

    #1053178
    Brian
    Keymaster

    Hi,

    I can try to help clear up what is wrong here.

    You cannot have a function with the same name and the text domain must match the text you are trying to change.

    The text domain is different for Event Tickets Plus.

    I got this to work for me:

    /*
    * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
    * See the codex to learn more about WP text domains:
    * http://codex.wordpress.org/Translating_WordPress#Localization_Technology
    * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
    */
    function tribe_price_wording_change ( $translations, $text, $domain ) {

    // Put your custom text here in a key > value pair
    // Example: 'Text you want to change' > 'This is what it will be changed to'
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key > values, but make sure to separate them with a comma
    $custom_text = array(
    'Price:' => 'Price: (USD)',
    );

    // If this text domain starts with "event-", and we have replacement text
    if(strpos($domain, 'event-') === 0 && array_key_exists($text, $custom_text) ) {
    $text = $custom_text[$text];
    }

    return $text;

    }
    add_filter('gettext', 'tribe_price_wording_change', 20, 3);

    Notice the changes made here:

    if(strpos($domain, 'event-')

    and here:

    function tribe_price_wording_change ( $translations, $text, $domain ) {
    }
    add_filter('gettext', 'tribe_price_wording_change', 20, 3);

    That worked with the other function present too on my site and should work for you.

    Thanks

    #1053600
    Matthew
    Participant

    Hi Brian,

    That worked nicely.

    Thanks mate,
    Mat

    #1053616
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to edit the submit an event form’ is closed to new replies.