Jump to content

Open PDF instead of HTML invoice after order


Sybille

Recommended Posts

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

Link to comment
Share on other sites

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;
   }

});

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated