Sybille Posted July 18, 2016 Share Posted July 18, 2016 Hi I would like to just use the PDF format of the invoices instead of the HTML view where you have the option to open the PDF. I already modified the overview "my invoice". My users now get displayed just the PDF invoice when they click on one of their invoices. But when the user completes a new order the HTML view of the invoice is shown. Here I would like that instead of the HTM view the PDF invoice would be opened. Where I have to change that? I try to avoid to user HTML and PDF invoice. Thanks in advanced for your support. Sybille 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 18, 2016 Share Posted July 18, 2016 Hi Sybille, the best option I think about is to redirect client to PDF invoice URL, only if the invoice is already "Paid", here is how: create new PHP file inside /includes/hooks/ directory and put the following code inside it <?php add_hook("ClientAreaPageViewInvoice", 1, function($vars){ global $CONFIG; if ($vars['status']=="Paid"){ header("Location: ".$CONFIG['SystemURL']."/dl.php?type=i&viewpdf=1&id=".$vars['invoiceid']); exit; } }); 0 Quote Link to comment Share on other sites More sharing options...
Sybille Posted July 19, 2016 Author Share Posted July 19, 2016 Hi Sentq Thanks a lot. Exactly what I needed. Have a great day! Many Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Sybille Posted July 19, 2016 Author Share Posted July 19, 2016 Because if I open the PDF directly the shopping card page will still be opened and the pdf opens in a new window. That's why I don't open the PDF without the HTML page. I changed the content of viewinvoice.tpl to a confirmations page where you have links to the PDF Invoice, to your services overview and so on. Is there an opportunity to open the HTML view in the frame of the portal? At the moment the HTML page opens in the same window, but without the menu, sidebar and so on. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.