Support

Home Forums Event Espresso Premium Change invoice bill to name

Change invoice bill to name

Posted: December 1, 2016 at 10:57 am

Viewing 7 reply threads


modernearth

December 1, 2016 at 10:57 am

I am trying to populate the ‘bill to’ name on the invoice based on a selection in the registration form. I have seen from other threads to use [PRIMARY_REGISTRANT_ANSWER*] but where do I put all the shortcodes to make it work?


Tony

  • Support Staff

December 1, 2016 at 11:14 am

Hi there,

You would add them to the Invoice template within:

Event Espresso -> Messages -> Default Message Templates (tab) -> Invoice.

Then place the shortcode wherever you want the data to be output. You will likely want to replace these – http://take.ms/xwrth


modernearth

December 1, 2016 at 11:20 am

And what variable would I have to add after the * in [PRIMARY_REGISTRANT_ANSWER*]? I’ve tried for both the Question Text as well as the Question Label and it just returns blank on the invoice.. Better yet can I add it somehow dynamically? example being we want the name on the invoice being either for the individual or their organization, based on what they select in registration.. So ultimate goal would be if organization gets selected then it withdraws the name from the organization name input and uses that for the invoice, and vice versa with selecting individual.


Tony

  • Support Staff

December 1, 2016 at 11:39 am

And what variable would I have to add after the * in [PRIMARY_REGISTRANT_ANSWER*]?

It’s the question text but it looks like your using the wrong shortcode. It should be [PRIMARY_REGISTRANT_ANSWER_*]

So a ‘Bill To?’ question would be [PRIMARY_REGISTRANT_ANSWER_*Bill To?]

Better yet can I add it somehow dynamically?

We don’t currently have any shortcodes that will do that for you.

For that to work you would need your own custom shortcode that checked the selected answer and returned the value from either of the others.

You could have both shortcodes within the template:

[PRIMARY_REGISTRANT_ANSWER_*Bill To Organization]
[PRIMARY_REGISTRANT_ANSWER_*Bill To Individual]
[PRIMARY_REGISTRANT_ANSWER_*Address]

If they don’t provide an answer for either one of those shortcodes it will return an empty string.

Would that work?


modernearth

December 1, 2016 at 11:39 am

I got the shortcode working, so my only question now would it be able to be dynamically populated?


modernearth

December 1, 2016 at 11:43 am

It wouldn’t work since even if someone signs up and has it billed individually, they would still have the ability to fill out the Organization Input which would then show up also on the invoice as well. The individual and the organization are two different input fields and down a few lines is a radio button asking which one would they like to bill to. If there is no easy way, would it be at all possible to implement a jQuery function of some kind to override what shows up on the invoice? and if so what would be the hook/filter where I should look into?


Tony

  • Support Staff

December 1, 2016 at 11:50 am

That may be possible for the HTML view, but not for the PDF’s so would be inconsistent.

The other option is to create your own custom shortcode which checks the value of the dropdown and returns the value from either the Individual or Organization question based on the value selected.

For an example of how to add your own shortcodes take a look here:

https://gist.github.com/Pebblo/e87cc8e30c4848dcdfe2

That can be used as a starting point but will need a fair amount of customization for what you are requesting.


modernearth

December 1, 2016 at 12:48 pm

Thanks Tony, I will look into that.

Viewing 7 reply threads

The support post ‘Change invoice bill to name’ 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