Skip to content

Adding Email Address to the layout

jumph4x edited this page Sep 13, 2010 · 1 revision

It is pretty easy to add an email address to the printed invoice layout.

In your customization extension, (which should be loaded last using SPREE_EXTENSIONS_LOAD_ORDER in preinitializer.rb,) override show.pdf.prawn from app/views/admin/orders in the prawn extension. I chose to add the email right above the address, so I added the following line after line 22:

text (@order.user ? @order.user.email : @order.email)

The conditional switch is needed for guest checkouts, so I recommend you keep it. Completed file should look something like this: http://gist.github.com/422325

Clone this wiki locally