Support

Home Forums Event Espresso Premium Early Bird Pricing wording on the front end

Early Bird Pricing wording on the front end

Posted: June 3, 2013 at 2:43 pm

Viewing 1 reply thread


Kristina Mausser

June 3, 2013 at 2:43 pm

Right now, when I set a price and an early bird discount, it shows up on the front end formatted this way:

$799.00 (including $121 early discount)

I don’t like this. The only line is wrapped in a single class with no spans so I can’t get what I want via CSS. I would prefer it says:

$799.00 (after $121 early bird discount) 

or even

$799.00 (early bird)

Is this possible?


Josh

  • Support Staff

June 4, 2013 at 11:38 am

Hi Kristina,

One way to do this would be by using the WP gettext filter (which lets you do a translation). If you add this code to your custom functions file it will translate the text string you’re looking to change:

function my_ee_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        ' (including %s early discount) ' => ' (after %s early bird discount) ',
        // 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', 'my_ee_filter_gettext', 10, 3 );
Viewing 1 reply thread

The support post ‘Early Bird Pricing wording on the front end’ 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