Support

Home Forums Event Espresso Premium Changing ticket label for "qty*" radio button to "Select"

Changing ticket label for "qty*" radio button to "Select"

Posted: September 23, 2014 at 4:26 pm

Viewing 3 reply threads


ATD Cascadia Chapter

September 23, 2014 at 4:26 pm

I can find out how to do this by editing the files in the plugin but I’d like to do it with a child theme so it’s update friendly. Is this possible?


Lorenzo Orlando Caum

  • Support Staff

September 23, 2014 at 4:52 pm

Hi,

That can be changed by using a gettext filter in a site specific plugin or your child theme’s functions.php file:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#plugins

function mycustom_filter_gettext_qty_select( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'qty*' => 'Select'
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'mycustom_filter_gettext_qty_select', 10, 3 );

You could also using a plugin like Quick Localization or Loco Translate.


Lorenzo


ATD Cascadia Chapter

September 24, 2014 at 5:24 pm

Thank you very much. I assume this solution will do this site wide for all instances of gty* so it’s not a great solution for specific instances but for my use this should be fine.

Thank you!


Lorenzo Orlando Caum

  • Support Staff

September 24, 2014 at 5:52 pm

Hi,

It will look for an exact match for “qty*”

If it sees qty, then that won’t be changed.


Lorenzo

Viewing 3 reply threads

The support post ‘Changing ticket label for "qty*" radio button to "Select"’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso