Support

Home Forums Event Espresso Premium Functions.php custom changes lost after EE4.6.16 upgrade

Functions.php custom changes lost after EE4.6.16 upgrade

Posted: March 23, 2015 at 10:57 am

Viewing 17 reply threads


Randy

March 23, 2015 at 10:57 am

Hi,

Back in August 2014 I received some help from Lorenzo and Dean on changing the text in the yellow boxes that appear when a payment is selected. That help is found here: https://eventespresso.com/topic/change-payment-instructions/

Now that I updated to EE 4.6.16 the custom changes don’t work anymore and I am not sure why they were lost.

Any suggestions on how to get this working again?


Lorenzo Orlando Caum

  • Support Staff

March 23, 2015 at 12:57 pm

Hi Randy, that coding snippet was needed on the old version of Event Espresso 4.4.x as we didn’t have a way to change that messaging through the WP dashboard.

That is now available in Event Espresso 4.6.x.

Head to your WP dashboard and then click on Event Espresso –> Payment Methods.

Then click on check.

Set the description to your custom messaging and save changes:

http://cl.ly/image/0p2Q153J0U2A


Lorenzo


Randy

March 23, 2015 at 4:38 pm

Lorenzo,

Thanks for the update. It is much better to customize the message that way than in functions.php.

However now I have a problem with how it is displayed. It seems to not allow a line break so what I have as a set of options for how to pay by check is displayed as one big paragraph instead of options 1 2 and 3 being listed.

I can’t seem to be able to get it to break after each option so that they are clearly displayed.

Is there something I’m missing?


Lorenzo Orlando Caum

  • Support Staff

March 23, 2015 at 4:44 pm

Hi,

Try manually adding a line break using the br tag between the sentences.

http://www.w3schools.com/tags/tag_br.asp


Lorenzo


Randy

March 23, 2015 at 6:20 pm

Hi Lorenzo,

I should have mentioned that I tried using <br> but it didn’t make any difference.


Dean

March 24, 2015 at 6:50 am

Hi,

HTML should work. For instance this:http://take.ms/rhFTd becomes this http://take.ms/iap3j


Randy

March 24, 2015 at 9:01 am

Dean,

I may be miscommunicating here and if so I apologize. The box that I want to edit is the first yellow box that pops up after clicking “Select your payment method”.

I tried to set the description to the text I wanted as in this image http://tinyurl.com/k6rjxvf

What I end up with this image: http://tinyurl.com/ljspjrb

Before upgrading to 4.6.16 I had coded functions.php so this box had the text I wanted because for some reason people were confused as to how they could make a payment by check so I wanted to explain it to them before they finalized payment.

After they finalize payment they are told a second time as seen here: http://tinyurl.com/k2hrd9u

I hope this makes sense because I also will need give special instructions for online payments as we are not using the gateways via EE4 right now. Instead I’m using this box to provide a to our own payment gateway which is offline from EE4 and on a different website altogether. I was able to do all this via code in functions.php in EE4.4

Thanks for your help


Lorenzo Orlando Caum

  • Support Staff

March 24, 2015 at 9:46 am

Hi,

it looks like it is dropping the line breaks so we’ll need to take a look at that.

The good news is we can use a similar version of the prior example to change it.

First, change the description back to this for the check payment method:

After clicking “Finalize Registration”, you will be given instructions on how to complete your payment.

Then use this (remove the existing function that is similar to this):

function ee_override_check_payment_preview_messaging_2($phrase) {
  $phrase = str_replace('After clicking "Finalize Registration", you will be given instructions on how to complete your payment.', 'Replace me with a new phrase.', $phrase);
  return $phrase;
}
add_filter('the_content', 'ee_override_check_payment_preview_messaging_2', '175');


Lorenzo


Randy

March 24, 2015 at 11:00 am

Lorenzo,

I made the changes as you suggested. The first thing I did was just leave your code unaltered so that the replacement would actually be “Replace me with a new phrase” however after testing, the only time the new phrase shows up is after clicking finalize payment. Then if I click on “View Payment Options” which then takes me to Registration checkout. I can then click on cheque option and thats when the replacement phrase shows up.


Lorenzo Orlando Caum

  • Support Staff

March 24, 2015 at 12:16 pm

Hi,

What is the current phrase that you are trying to change?

Just copy and paste it here.


Lorenzo


Randy

March 24, 2015 at 2:16 pm

This is what it says now:

After clicking “Finalize Registration”, you will be given instructions on how to complete your payment.

This is what I want it to say:

Three options are available for paying by check:

1. place your check in a envelope and put it in the giving box in the auditorium.

2. Include it in your personal giving envelope noting the purpose of the amount.

3. Mail it to the address listed:

Payable to: Heartland Baptist Fellowship

Payment Address:

P.O. Box 351
Harrisonville, MO
United States
64701


Lorenzo Orlando Caum

  • Support Staff

March 24, 2015 at 2:45 pm

This should work. I just checked the exact phrase against the current release:

function ee_custom_messaging_check_payments( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'After clicking "Finalize Registration", you will be given instructions on how to complete your payment.' => 'Replace me with your new message',
        // 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', 'ee_custom_messaging_check_payments', 10, 3 );

Note: you’ll need to add line break tags to separate the sentences when you replace the sample text in the example.


Lorenzo


Randy

March 24, 2015 at 7:45 pm

Lorenzo,

I am sorry but it doesn’t seem to be working. I don’t think I have the ability or the time to figure out how to make it work so I’m just going to try a different way to explain the payment process or I may just back up to 4.4.


Lorenzo Orlando Caum

  • Support Staff

March 25, 2015 at 10:43 am

Okay, I see what is happening. The content is loaded via ajax instead of a page load so it doesn’t change at that time.

Could that information be added to this area of the check payment gateway?

http://cl.ly/image/2S0s43190Q2w

Additionally, it could be added to the registration pending payment message type via the messages system.


Lorenzo


Randy

March 25, 2015 at 10:51 am

Lorenzo I go ahead last night and add the information to the instruction block as you suggest. That will work. The block that I wanted to have modified is the instruction block so that as soon as the check button was selected they were greeted with the instruction block pop up giving direction on payment methods. In reality this is probably more than is necessary but I had found that doing this helped in the decision on how to pay especially since we don’t use a payment gateway within eventespresso.

I edited the instruction block to give very detailed instruction and was even able to put those instructions in a colored box to highlight the instructions.

I think this should take care of things

Thanks for your help and patience with me on this.


Lorenzo Orlando Caum

  • Support Staff

March 25, 2015 at 11:18 am

Alright, there is also one other spot available. The yellow box that appears towards the top of the thank you page.

That messaging can also be changed. Would that be helpful for your registrants?


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

March 26, 2015 at 4:25 pm

Hi Randy, we’ve enhanced the payment method description area in 4.6.18 to allow tags like br (line break) and other html tags.

Backup your WordPress and then update to the latest release.

Then you can add your payment recommendations / steps again as mentioned in your original post and it should now work.

Thanks and enjoy your weekend.


Lorenzo


Randy

April 3, 2015 at 8:59 am

Lorenzo,

I have been out for most of the week and just now able to try 4.6.18. It did work very well and I was able to put the custom instructions in the block.

Thanks for all your work and all the team at Event Espresso.

Randy

Viewing 17 reply threads

The support post ‘Functions.php custom changes lost after EE4.6.16 upgrade’ 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