Support

Home Forums Event Espresso Premium Remove the ability for customer to view an Invoice

Remove the ability for customer to view an Invoice

Posted: September 27, 2017 at 3:21 pm

Viewing 15 reply threads


dionne.c

September 27, 2017 at 3:21 pm

WE would like to send our customer’s the invoice.

How can I hide the “View Invoice” link on the Thank You page.

How can I hide the “Switch to Invoice” button on the Order Confirmation Receipt?


Tony

  • Support Staff

September 28, 2017 at 2:39 am

Hi there,

How can I hide the “View Invoice” link on the Thank You page.

The easiest method is using some CSS:

#espresso-thank-you-page-payment-details-dv .ee-invoice-lnk {
    display: none;
}

You can add that to Appearance -> Customize -> Additional CSS

Please refer to this guide for more detailed information about the CSS customizer: https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress

How can I hide the “Switch to Invoice” button on the Order Confirmation Receipt?

Go to Event Espresso -> Messages -> Default message tmeplates -> Receipt

Remove the [INVOICE_RECEIPT_SWITCHER_BUTTON] shortcode and save.


dionne.c

September 28, 2017 at 7:35 am

Is there a way to edit the message that displays an Invoice payment method. User clicks on “View Full Order Confirmation Receipt”, under the section titled “Payments” there is text that reads “No approved payments have been received.” How can I change this text to read something else?


dionne.c

September 28, 2017 at 8:27 am

in addition to the above, how can I remove the link “Please make a payment”


Tony

  • Support Staff

September 28, 2017 at 9:12 am

Is there a way to edit the message that displays an Invoice payment method.

I’m not sure which message this is, can you provide more details?

User clicks on “View Full Order Confirmation Receipt”, under the section titled “Payments” there is text that reads “No approved payments have been received.” How can I change this text to read something else?

To change that text you’ll need to ‘translate’ it to something else. For that you can use the furnction shown here:

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

The string you need to translate for there is: No approved payments have been received.

'No approved payments have been received.' => 'Your custom text',

in addition to the above, how can I remove the link “Please make a payment”

You can use the same function as above to translate the string used for that link:

'%sPlease make a payment.%s' => ' ',

You can add your custom function to a Custom Functions Plugin.


dionne.c

September 29, 2017 at 11:24 am

I’ve added the below code to my functions.php but that didn’t seem to work. There was no change. Can you please review and let me know what I might be missing?

function mycustom_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Register’ => ‘Sign up’,
‘Confirm and go to payment page’ => ‘Complete registration’,
‘No events available…’ => ‘No upcoming classes at this time…’,
‘click here to add a new state/province’ => ‘click here to enter address outside US/Canada’,
‘No approved payments have been received.’ => ‘Your custom text’,
‘%sPlease make a payment.%s’ => ‘ ‘,
);

// 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;
}


Josh

  • Support Staff

September 29, 2017 at 2:26 pm

It appears to be missing the add_filter() call:

add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 );


dionne.c

October 2, 2017 at 7:02 am

I’ve added the add_filter(). That did not work either. When I went to register I got the following error message “Parse error: syntax error, unexpected ‘up’’ (T_STRING), expecting ‘)’ in /home/fasteras/public_html/conference/wp-content/themes/themify-ultra-child/functions.php on line 28”

Could you please look at my code below and see if you see anything weird?

*** BELOW IS THE CODE I PASTED INTO MY functions.php

function mycustom_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Register’ => ‘Sign up’,
‘Confirm and go to payment page’ => ‘Complete registration’,
‘No events available…’ => ‘No upcoming classes at this time…’,
‘click here to add a new state/province’ => ‘click here to enter address outside US/Canada’,
‘No approved payments have been received.’ => ‘Your custom text’,
‘%sPlease make a payment.%s’ => ‘ ‘,
);

// 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 );


dionne.c

October 2, 2017 at 7:07 am

Is there an easier way to just “hide” the link “Please make a payment” that appears on the Order Confirmation when using the Invoice Payment Method?


Tony

  • Support Staff

October 2, 2017 at 7:07 am

Can you post the full content of your child themes functions.php file, please?

You can either create a Gist or Pastebin and post the URL here to view.

The above means there is an error in the code used in that file but we don’t know which line is line 28 and its not obvious from the above what the problem is.


Tony

  • Support Staff

October 2, 2017 at 7:13 am

Is there an easier way to just “hide” the link “Please make a payment” that appears on the Order Confirmation when using the Invoice Payment Method?

It’s not when using the Invoice payment method, its when no payments have been made on a transaction, the same will be displayed with any transaction that doesn’t have a payment regardless of the payment method used.

Translating the string being used to display that link is the easiest method to remove it.


dionne.c

October 2, 2017 at 7:14 am

Hi Tony,

Instead of messing with the functions.php file, is there a way to just hide the link “Please make a payment” on the Order Confirmation?


Tony

  • Support Staff

October 2, 2017 at 7:18 am

Actually, you can remove it from the Receipt template.

Go to Event Espresso -> Messages -> Default messages templates -> Receipt.

In the ‘Main content’ section look for the [OWING_STATUS_MESSAGE_*] shortcode –
http://take.ms/YYFjF

Remove that and save.


dionne.c

October 2, 2017 at 7:19 am

Okay, I now see your response above and understand that the same will be displayed with any transaction that doesn’t have a payment. I’m okay with that and just need to quickly remove the link “Please make a payment”.

Are you saying there is no other way to quickly hide that link besides translating the string?

If so, can you provide me what the function should read?


dionne.c

October 2, 2017 at 7:20 am

I think we are posting to this thread at the same time, let me try your suggestion on the Receipt template. Thanks!


Tony

  • Support Staff

October 2, 2017 at 7:22 am

We are cross posting so replying to point to the above:

https://eventespresso.com/topic/remove-the-ability-for-customer-to-view-an-invoice/#post-252631

If so, can you provide me what the function should read?

The function you have above is correct (I just tested it on another site), but something in your functions.php file is wrong.

Try the method posted above for removing that text first.

Viewing 15 reply threads

The support post ‘Remove the ability for customer to view an Invoice’ 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