Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Created November 5, 2014 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzocaum/96f47b234b5e40fb30c4 to your computer and use it in GitHub Desktop.
Save lorenzocaum/96f47b234b5e40fb30c4 to your computer and use it in GitHub Desktop.
Workaround for invoice styling issue when fopen isn't available. Requires Event Espresso 4.5.x
  1. Backup your WordPress site:

http://eventespresso.com/wiki/how-to-back-up-your-site/

  1. Download the Event Espresso 4.5 pre-release from your Event Espresso account. This appears in the bottom right area of your account page. If you do not see the option, then you'll need to first join the pre-release channel: http://eventespresso.com/wiki/pre-release-channel-guide/

  2. Remove the existing version of Event Espress 4 and install the pre-release version of 4.5.

  3. Activate the pre-release version of Event Espresso 4.5 and migrate your data to the current version.

  4. Locate Event Espresso in the WordPress menus and go to Messages.

  5. On the Messages overview screen, click on html for the Invoice: http://cl.ly/image/430c0y1O3K3X

  6. This will take you to the Messages editor for the Invoice message type. Switch the editor to Text mode and you'll see the html code.

  7. Along the top you'll see the following:

<div class="print_button_div">
	<form method="post" action="[DISPLAY_PDF_URL]" >
		<input class="print_button noPrint" type="submit" value="Download PDF" />
	</form>
	<div class="clear"></div>
</div>
  1. You can remove it to remove the Downloadf PDF link or you can replace it with the following code to have the PDF generated by a third-party service called PrintFriendly:
<div class="print_button_div">
		<form>
			<input class="print_button noPrint" type="button" value="Print" onClick="window.print();return false;" />
		</form>
		<form method="post" action="javascript:(function()%7Bif(window%5B%27priFri%27%5D)%7Bwindow.print()%7Delse%7Bvar pfurl%3D%27%27%3Bpfstyle%3D%27nbk%27%3BpfBkVersion%3D%271%27%3Bif(window.location.href.match(/https/))%7Bpfurl%3D%27https://pf-cdn.printfriendly.com/ssl/main.js%27%7Delse%7Bpfurl%3D%27http://cdn.printfriendly.com/printfriendly.js%27%7D_pnicer_script%3Ddocument.createElement(%27SCRIPT%27)%3B_pnicer_script.type%3D%27text/javascript%27%3B_pnicer_script.src%3Dpfurl %2B %27%3Fx%3D%27%2B(Math.random())%3Bdocument.getElementsByTagName(%27head%27)%5B0%5D.appendChild(_pnicer_script)%3B%7D%7D)()%3B" >
			<input class="print_button noPrint" type="submit" value="Download PDF with PrintFriendly" />
		</form>
		<div class="clear"></div>
</div>
  1. Save changes to the message type.

You can then complete a test registration and then click on the Invoice link. You'll be brought to the invoice in and it can be printed or downloaded as a PDF via PrintFriendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment