Support

Home Forums Event Espresso Premium Bill To: needs organisation info on invoice

Bill To: needs organisation info on invoice

Posted: May 21, 2015 at 10:03 pm

Viewing 10 reply threads


ac

May 21, 2015 at 10:03 pm

Hi we need the main registrants organisation in the “Bill to” section of the invoice.

We are using EE4.4.7 (can’t upgrade as yet to the latest as we’ve customized it).

Trying to change the invoice template: /event-espresso-core-reg/modules/gateways/Invoice/lib/templates/receipt_body.template.php

to include the following

<div class=”organization”><?php echo $attendee_organization; ?></div>

doesn’t work.

What do we do wrong?
Thanks,
G


Josh

  • Support Staff

May 22, 2015 at 8:02 am

Hi G,

It turns out $attendee_organization isn’t a variable that’s set in the invoice template.

I’m going to suggest updating to the current version so you can add the organization info to the invoice right from the WP editor by means of a shortcode.

You should be able to move your customizations into the new version. Better yet, instead of hacking core files, you can use the many action hooks and filter hooks to make your customizations. If there’s a spot where a hook will benefit your customization work, please do a pull request and we can work with you on adding it to an upcoming release.


ac

May 22, 2015 at 4:27 pm

We need a quick fix for now – We are planning a proper version upgrade which will need time to plan & do.

So could you please provide us with the code to fetch this information – thanks,
G


ac

May 25, 2015 at 6:22 am

Could somebody point us in the right direction.

What would the code be to retrieve the main registrants organisation info in the invoice.class.php?

Something like:
“$template_args[‘attendee_organization’] = $primary_attendee->organization();”

Thanks,
G


ac

May 25, 2015 at 4:16 pm

Hi is there any one who can help?
Thanks,
G


Dean

May 26, 2015 at 5:16 am

Hi,

Sorry for the delay in responding.

I have looked at this and I cannot see a way to add this information in without hacking at core files.

The latest version of EE has a shortcode that can be added to add in attendee questions – [PRIMARY_REGISTRANT_ANSWER_*]

Sadly, your version does not have that.

You could look at /wp-content/plugins/event-espresso-core-reg/core/libraries/shortcodes/EE_Primary_Registration_Details_Shortcodes.lib.php to see how that shortcode works and perhaps add it to your version, but we do NOT recommend modifying core files like this, nor do we provide support for it.


ac

May 26, 2015 at 5:31 pm

Thanks for your reply.

1) we do understand that you are not supporting modifications to the core files.
2) we tried your suggestions & looking through the whole code the attendee & primary_attendee instance do not have an organisation item.

Can you just post an example code how to retrieve this information.

It’s only a temporary solutions (but very important for us) till we upgrade to the latest version.

Many thanks,
G


Josh

  • Support Staff

May 28, 2015 at 10:13 am

Hi G,

Thanks for understanding that we are not supporting modification to core files. With that, here’s a link to the commit where the feature was added which you (or a PHP developer on your team) can use as a starting point in order to add to the older version:

https://github.com/eventespresso/event-espresso-core/commit/5a838a60ab7128a823c5471ecbda963619d55457

Again, please remember that this modification is untested and not supported for your version.


ac

June 2, 2015 at 12:39 am

Thanks Josh for the pointer – we are nearly there,

1) We replaced “EE_Primary_Registration_Details_Shortcodes.lib.php” with the newest one – so that the new shortcodes are added.

2) Then we added the shortcode to the invoice template:
<!–div class=”adr”>[PRIMARY_REGISTRANT_ANSWER_*Organisation]</div–>

But the short code is not executed – instead of the Organisation name it shows the shortcode “[PRIMARY_REGISTRANT_ANSWER_*Organisation]”.

How to we get them to execute the shortcode.

Thanks,
G.


Dean

June 2, 2015 at 4:31 am

I think probably the easiest way to do it (though I do not think this is the *correct* way to do it), would be to look at the $SearchValues and $ReplaceValues arrays in /wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php

The actual way it does it is similar, but found in different files. The folder here /wp-content/plugins/event-espresso-core-reg/core/libraries/shortcodes contains all the files that replace the shortcodes in the invoice (and other message types).

The PRIMARY_REGISTRANT_ANSWER_* shortcode would be found in /wp-content/plugins/event-espresso-core-reg/core/libraries/shortcodes/EE_Primary_Registration_Details_Shortcodes.lib.php – screenshot of code: http://take.ms/dQiCF There may be other code related to this but I couldn’t see any from my quick look.


Lorenzo Orlando Caum

  • Support Staff

December 8, 2015 at 6:29 pm

Hi,

When we shared feedback on your question earlier this year, copying over the templates for editing was the recommended way to edit the templates for the Invoice or Receipt.

That has changed as Event Espresso 4 now has an editor to edit those templates through the WP dashboard.

It can be found in Event Espresso –> Messages. You’ll now be viewing the Messages Overview screen. Now look for Invoice or Receipt and click on Purchaser. Here is an example of how they appear on the Messages Overview Screen:

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

If you do not see them, then you may be using an old version of Event Espresso 4 or they may be on page 2 so you can paginate (browse) to page 2 and they should be there.

Here is a change log for Event Espresso 4:

https://eventespresso.com/wiki/ee4-changelog/

If you have any new questions about the using the messages system, then please create a new support post in our support forums:

https://eventespresso.com/support/forums/


Lorenzo

Viewing 10 reply threads

The support post ‘Bill To: needs organisation info on 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