Support

Home Forums Event Espresso Premium Default to Invoice Rather Than Receipt

Default to Invoice Rather Than Receipt

Posted: December 2, 2019 at 2:11 pm


ATPI.org

December 2, 2019 at 2:11 pm

I found a response in the user forums from 2016 but I’m wondering if EE4 has an easier solution. I want a user to default to the Invoice view rather than the Receipt view when they click on View Full Order Confirmation Receipt. Is there a way to do this?


Josh

  • Support Staff

December 2, 2019 at 5:03 pm

Hi,

What you can do is deactivate receipts (in Event Espresso > Messages > Settings > HTML) There you can drag the “Receipt” message type into the “Inactive” box.

This will remove the “View Full Order Confirmation Receipt” button. If you wish to allow downloading the invoice from the Thank You page, you can activate the Invoice payment method in Event Espresso > Payment Methods.

A link to download an invoice can also be included in the Registration confirmation email.


ATPI.org

December 2, 2019 at 7:16 pm

Josh – Thanks for the instructions. I think I’ve got most of it working but when I get to the Thanks page the information to download the invoice never shows up. Instead you see the text “loading transaction and payment information” but nothing ever shows up. I have a screen shot I can provide if you’ll let me know how. Thanks.


Tony

  • Support Staff

December 3, 2019 at 4:38 am

That can happen if WP Heatbeat has been disabled on your server.

Are you using any plugins to control WP Heartbeat? For example Heartbeat Control.


ATPI.org

December 3, 2019 at 12:18 pm

Tony – We aren’t doing anything with WP Heartbeat. I’m not aware of any of the plugins we are running on the site that control this.


Tony

  • Support Staff

December 4, 2019 at 3:01 am

I’ve checked your site and the hearbeat.js file isn’t loading on the thank you page.

There are 3 scripts that need to load from Event Espresso on the thank_you_page for the above to function:

espresso_core.js (which is loading)
heartbeat.js (which is not loading)
thank_you_page.js (which is also not loading due to having heatbeat as a dependency)

So it would appear that somewhere, someone, has disabled the heartbeat API on your site.

Which host are you using for the site? Some disable it by default, for example, wpengine:

https://eventespresso.com/wiki/setup-wpengine-hosting-event-espresso/#heartbeat

So it may be worth opening a ticket with your host and confirm with them if the do something similar.


ATPI.org

December 4, 2019 at 7:17 am

Tony – We are using 1&1 Ionos for hosting. I’ll check with them and let you know. Thanks.


ATPI.org

December 5, 2019 at 6:50 pm

I have a developer looking at the website to see what he can find. 1&1 is not doing any blocking. I’ve installed Heartbeat Control and it shows that Heartbeat is enabled. Here’s the note from the WordPress person – I’ve been combing through and I’m having trouble finding where the plugin calls on heartbeat. I cant find heartbeat being blocked and im not seeing any errors. We probably need more info from the plugin creators to help troubleshoot further.


Tony

  • Support Staff

December 6, 2019 at 2:56 am

I’ve installed Heartbeat Control and it shows that Heartbeat is enabled.

As far as I am aware, Heartbeat control does not tell you if heartbeat is enabled. It shows settings that show if the plugin is set to allow, disable or modify but that’s different from it being enabled on the site.

I’ve been combing through and I’m having trouble finding where the plugin calls on heartbeat.

Searching the EE codebase for ‘heartbeat’ will return 5 results.

3 of them are checking the ‘action’ set on a request to check if the current request is from heartbeat, the other 2 enqueue heartbeat by setting it is a dependency of another script.

The one that enqueues heartbeat on the thank you page can be seen here: https://github.com/eventespresso/event-espresso-core/blob/master/modules/thank_you_page/EED_Thank_You_Page.module.php#L320-L331

That is registering the thank_you_page.js file I mentioned earlier and sets espresso_core (a core EE js file) and heartbeat as dependencies.

Dependencies listed on a script are automatically enqueued when that script is called, see the second bullet point HERE.

Right after it registers the script, it enqueues it to load on the page.

Is also sets the script to load in the footer, we often see sites not calling wp_footer and therefore the script won’t load on that call, however looking at your site it looks like it does call wp_footer as I can see scripts before </body>.

What I would do next is to check it is not a theme/plugin, is switch to a default theme and confirm if it works then.

You can do that in various ways but I would use the WP Health Check plugin, enable troubleshooting mode (Tools -> Site health -> Troubleshooting).

That will set you as the admin to use a default theme with no active plugins.

Enable just Event Espresso whilst in troubleshooting mode (Admin bar -> Troubleshooting mode -> Manage active plugins -> Event Espresso -> Enable while troubleshooting)

Open up the thank you page for a registration and see if it works then.

Side Note – to view the thank you page a need a valid registration. Whilst I don’t mind creating a new registration each time to do so, if you leave a single instance of my pending payment registration on the site until this issue is fixed I won’t keep messing up your registrations with additional regs.


ATPI.org

December 8, 2019 at 11:30 am

Tony – it looks like deactivating some plug ins and then reactivating them in a different order solved the problem. The problem plugins appear to be Sucuri Security, Elementor and maybe one or two others that just weren’t playing well together. I’ve left your registration active if you want to check it. I did break it again at one point last night as I started reactivating plugins so I’ve left all the ones that I don’t use on a regular basis as inactivate and will just activate them when I need them.


Tony

  • Support Staff

December 9, 2019 at 5:18 am

Yeah, that now loads.

Usually, if you let us know the specific plugins causing the conflict we can check to see if there is a way to fix/workaround that, however, here we are simply just setting heartbeat as a dependency so unless a plugin is explicitly blocking heartbeat I can’t think of anything we could do.

I’m happy to take a look if you let me know the pluigns but I’m not sure what I’ll find.

However, I do have something else you can add to your thank you page which may help further with this. I’ve previously created a template that loads the Invoice link in place of the Receipt button in the confirmation section at the top of the page.

You’ll need to be using a child theme (or a full custom theme) on your site to load it, creating a child theme if you are not using one isn’t difficult and instructions can be found here:

https://developer.wordpress.org/themes/advanced-topics/child-themes/

The custom template can be found here:

https://gist.github.com/Pebblo/8cac847b47569479e33307699dcfcdd7#file-thank-you-page-overview2-template-php

Click the ‘Raw’ button on the right, then right click on the contents and do save as.

Remove the ‘2’ from the file name and save it as thank-you-page-overview.template.php

Place that template in the root directory of your child theme and your done.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Tony 3 days, 17 hours ago ago

Topic Tags

Tagged: ,

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!