Support

Home Forums Event Espresso Premium change 'sold out' text to 'full'

change 'sold out' text to 'full'

Posted: December 2, 2015 at 4:50 am


Smart Robbie

December 2, 2015 at 4:50 am

Hi, on my events, I have a particular amount of people per event, it is a dance class.

When it books out, it says ‘SOLD OUT’. How can I change this text to ‘FULL’ on the event page (this will apply to all events):

http://www.littlelightsdance.com/events/blazing-lights-boys-3-5-5-5yrs-tuesday/


Tony

  • Support Staff

December 2, 2015 at 5:36 am

Hi there,

The easiest way to do this is to translate the Sold Out message to whatever you prefer. We have example of how to do this here:

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

Using that custom function you could use something like this:

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Sold Out' => 'Full',
        // 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', 10, 3 );

You can add that to a Site Specific Plugin or your themes functions.php (preferably the site specific plugin)

It will then look like this – http://take.ms/zdbWd

The support post ‘change 'sold out' text to 'full'’ 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