Jump to content

Link to download PDF invoice


Recommended Posts

Hi all,

I am trying to take off the "back to orders" link on the order confirmation page which directs you to the order history. Instead I would like to replace it with a link that lets you open the pdf invoice right away by clicking on it (same function as the "Download your invoice as a .PDF file" in the order details on the order history page.

Does anybody know how to code this?

Thanks in advance!

Link to comment
Share on other sites

  • 4 months later...
  • 2 years later...

So I had to deal with this problem and it took me a lot more time to solve then i would like to ever admit. ( this example is based on a bankwire payment module )

 

Here is a little guide how you can achieve that:

 

Go to bankwire module in the main modules folder and locate a bankwire.php file.

 

Jump to line 205 and add this exact line

 

if (isset($params['objOrder']->secure_key) && !empty($params['objOrder']->secure_key))
				$this->smarty->assign('secure_key', $params['objOrder']->secure_key);

Then go to payment_return.tpl located in your theme folder and modify it ( add the following row to display a pdf download link )

 

<a href="index.php?controller=pdf-invoice?id_order={l s='%d' sprintf=$id_order mod='bankwire'}&secure_key={l s='%s' sprintf=$secure_key mod='bankwire'}" target="_blank">{l s='Download your invoice as a PDF file.'}</a>

And now you should have a working pdf invoice downlaod link :) ( Tested and working on my own project )

Best regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...