Support

Home Forums Event Espresso Premium Cart/Basket wording

Cart/Basket wording

Posted: December 8, 2015 at 2:56 am


Meredith Whitely

December 8, 2015 at 2:56 am

Can the text on the cart be less wordy? – http://screencast.com/t/jug3M18I8xIU

Can’t see the change on the .po/.mo files, or a filter.


Seth Shoultes

  • Support Staff

December 8, 2015 at 10:15 am

Hello Meredith,

You can use this custom function to change the text strings:

That code can be placed in your wordpress-theme/functions.php file, or in a custom site specific plugin.

Please let us know if you have any further questions.


Meredith Whitely

December 8, 2015 at 1:32 pm

Thanks Seth, that hasn’t worked for me. Any ideas why?
Should this function work with other translated phrased functions, like with the notices? function ee_change_sample_ajax_messaging

$strings = array(
        'Grand Total Basket Total' => 'Grand Total',
        'Pre-Tax Subtotal Basket Subtotal' => 'Basket Subtotal',


Lorenzo Orlando Caum

  • Support Staff

December 8, 2015 at 2:40 pm

Hi Meredith,

That area is from multiple strings that are being combined and I’ve created a ticket so we can simplify the messaging.

For now, you can set these strings to an empty value using the gettext filter:

Pre-Tax Subtotal
Grand Total


Lorenzo


Meredith Whitely

December 8, 2015 at 3:16 pm

Thanks Lorenzo, is this what you mean by empty strings?

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
		'Pre-Tax Subtotal' => '',
        'Grand Total' => '',
        // 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 );


Lorenzo Orlando Caum

  • Support Staff

December 8, 2015 at 3:45 pm

Yes, that looks correct and will set those to not appear leaving the remaining text.


Lorenzo


Meredith Whitely

December 9, 2015 at 1:39 am

I’ve ended up with this – http://snag.gy/3Tb2V.jpg

and I would like this please;
Pre-Tax Subtotal
Grand Total


Josh

  • Support Staff

December 9, 2015 at 5:30 pm

Hi Meredith,

We did some work on the Multi Event Registration add-on today and released an update that includes a change so the extra wording has been removed. With the new version, they look like this:

http://cl.ly/3K1Y423B3J2A

If you want to change the labels to be Pre-Tax Subtotal and Grand Total, we’ll have some new hooks available in another upcoming release of the MER plugin.


Meredith Whitely

December 10, 2015 at 4:00 am

Thanks Josh, let me know the hooks for the upcoming release when the time is right.

Thank you.


Josh

  • Support Staff

December 10, 2015 at 11:38 am

I can let you know when it’s ready.


Lorenzo Orlando Caum

  • Support Staff

December 31, 2015 at 10:57 am

Hi Meredith,

The latest version of the multiple event registration add-on corrects this messaging.

If you haven’t already updated then could you update and confirm that this fixes the messaging for you?


Lorenzo


Meredith Whitely

January 7, 2016 at 2:23 pm

Thanks Lorenzo, the update has improved the basket.

How can I change ‘The Event Cart is empty’ also, to replace with ‘The Basket is empty’?

Tried the .mo file and no change.


Lorenzo Orlando Caum

  • Support Staff

January 7, 2016 at 5:41 pm

Hi Meredith,

Would you happen to already be using this filter?

FHEE__EED_Multi_Event_Registration__set_definitions__event_cart_name

It sets the wording which is used which defaults to Event Cart.

Here is an example that is ready to go:

https://gist.github.com/joshfeck/ff986f3e848a2b910c47

Just add that to your child theme’s functions.php file or via a site specific plugin. Then change cart to Basket and save changes.


Lorenzo


Meredith Whitely

January 8, 2016 at 3:28 am

Yes Lorenzo, I’ve already got the filter in place, and its not working.

Is there a different filter?


Lorenzo Orlando Caum

  • Support Staff

January 8, 2016 at 11:11 am

Hi Meredith,

I made a mistake thinking the Event Cart messaging would be re-used there. Here is a solution that I’ve verified:

https://gist.github.com/lorenzocaum/5c140a0145ba4be54895


Lorenzo


Meredith Whitely

January 8, 2016 at 1:23 pm

Perfect, thank you!


Tony

  • Support Staff

January 8, 2016 at 2:20 pm

Hey Meredith,

That function Lorenzo has linked to will changes all instances of ‘Events’ to whatever you place there, meaning Event Espresso -> Events would also change.

Try using this one:

https://gist.github.com/lorenzocaum/5c140a0145ba4be54895

That function specifically targets that string within the cart.

The support post ‘Cart/Basket wording’ 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